Maybe you're getting DATABASE and TABLE mixed up... I take it that you have database CONTACTS and table CONTACTS.
In the console, this would be:
USE CONTACTS;
UPDATE CONTACTS SET age = 40 WHERE username = 'bob';
should do the job. If it's confused, it MIGHT be worth telling it that it's CONTACTS.age and CONTACTS.username, but that's unlikely.
And just as a general suggestion, don't use a table name that matches the database name or name a field the name of a table or database. Using different cases or giving it different titles makes things much easier for the table, especially when you start doing joins, etc.