select
 p.id
from
 t_rmd_object_photo p
   inner join
 t_sfas_vsr_route_object ro ON p.route_object_id = ro.id
   inner join
 t_sfas_vsr_route r ON ro.route_id = r.id
where
 r.scheduled_for < 1371427200