Update MySQL query

Now works on Xenforo 1.2+ by default