Fix condition on when can we cleanup the update logs imported from the
external database.