`cities` (`id`, `name`, `lastCheckTimestamp`, ...)
`urls` (`id`, `city_id`, `url`, `lastCheckTimestamp`)
SELECT `c`.`id` AS `city_id`, `u`.`id` AS `url_id`, `u`.`url` AS `url`
FROM (
SELECT `id`, `lastCheckTimestamp`
FROM `cities`
ORDER BY `lastCheckTimestamp`
LIMIT 1
) AS `c`
LEFT JOIN `urls` AS `u` ON `u`.`city_id` = `c`.`id`
AND `u`.`lastCheckTimestamp` < `c`.`lastCheckTimestamp`
LIMIT 1
Если запрос вернул url, то обработать его и изменить `lastCheckTimestamp` в urls
Если не вернул, то изменить `lastCheckTimestamp` в cities и снова выполнить первый запрос