What is funny is in the time the unsullied soldiers lands and captures Casterly Rock, Euron has already:
intercepted and destroyed Yara's fleet (presumably near the Stormlands coast), went back to King's Landing to present his prisoners to queen Cersei and
sailed from King's Landing all the way round the south of Westeros to the Westerlands just in time for Grey Worm to finish capturing Casterly Rock. If you have seen a map for Westeros, this is definitely a loooonnnggg journey.
Presuming the Unsullied transports and Yara's fleet sailed at the same time, Euron must have some really fast ships.

NOTE: Someone told me that since they never showed Euron himself at Casterly Rock or maybe that this was a fleet direct from the Iron islands (which is closer), that he was not there. BUT we do see his flagship,
Silence, at the naval attack, it is very unlikely the Ironborn have a another ship like that or that Euron himself has assigned his personal flagship to one of his deputies.
well, that last part makes sense. Euron could still be parading at King's Landing when Unsullied was halfway marching while his ships under his deputy command wait to ambush the ships.
but this season GoT the geographic and time dont seem to match anymore. when Khaleesi sail across the Narrow Sea, seems closer to reach Dorne 1st to drop off the Sandsnakes than to assemble at Dragonstone, then ask Yara to bring them back down.