Ok, the problem is that you are using '', e.g. 'users', 'age', '$age'. You dont need to do this, however if you want to, you are supposed to use the back tick(`), found to the left of your '1' key.
PHP Code:
$query = "UPDATE `users` SET `age` = `$age` WHERE `username` = `$username`";
PHP Code:
$query = "UPDATE users SET age = $age WHERE username = $username";
Both of those will work. Personally, I dont use anything like in the second example, but it's your preference. Hope this helps,