Okay, well, using the proper syntax, can you show us what you changed your code to?
Also, did you add the or die() code that I gave above? If so, does MySQL give you any errors? Can you echo out $query and show us what it looks like?
EDIT: Woops - didn't see that code before I replied. Still, does MySQL give any error messages at all? Can you echo out $query and show it to us?
EDIT2: Waaaait a minute! Why are you tyring to run an UPDATE query on every row in the table, and change the username to the $user variable? I think you meant to update the timestamp only, and use the username in a "WHERE" statement at the end of the query, e.g.:
UPDATE `active_users` SET `timestamp` = UNIX_TIMESTAMP() WHERE `username` = '%s'