Everything looks fine to me.
Just this line:
lnUpdated = m.lnUpdated + _tally
you will have only last updated records (these from Trans), but maybe you want only these.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.