Since you're interested in removing accounts that have not been activated you might be interested in knowing that unactivated accounts have a group ID of 3200 and as such "(registered = last_visit)" works but may perform extremely slightly worse than "g_id = 3200".
I'm not quite sure what you intend with "(registered > '.(time()-(60*60*24)).') AND (registered < '.(time()-(60*60)).')". If you wish to remove users that have not activated themselves after an hour, would not simply using ".time() - 3600.' > registered" work?
Finally, from a purely stylistic perspective, you don't need parentheses around each portion of the WHERE clause. You only need to use them if you're grouping multiple restrictions together. For instance, "(foo = bar OR alpha = beta) AND (a < b OR b > c)".
"g_id = 3200". = good point /thx for the advice.
(time()-(60*60*24) is supposed to check the users in the database only back by a certain value of days (this case 24h).
So I don't have to check users I have checked already days before. My be faster than checking all of them. Tell me if I'm
wrong or how to do it better.
stylistic perspective: You are right for sure! We (a friend and me) are both novices to php and therefore don't know better than that.
Hence, advice is always welcome.