Might be easier to add a last_sync timestamp to the database and just query for all rows where last_sync is before last_update.
Might be easier to add a last_sync timestamp to the database and just query for all rows where last_sync is before last_update.