(bug 37562) Fix order of checking for non-existent lqt_oldids

Change-Id: I26a77bd7d1c8973059ff4f3cdf353b412f2ae30a
Merge "(bug 37562) Fix order of checking for non-existent lqt_oldids"