MySQL uses the PASSWORD function keyword to encrypt a string. Use it like this:
INSERT INTO my_table (password_field)
VALUES (PASSWORD('test-password'))
WHERE user_name = 'mads';
NOTE: This is not standard SQL, so this will have to be re-written if you port to another DBMS. MySQL will create a 16-character encryption. If you try to store this in a character field of less than 16, the last characters will be truncated, and you'll never get a match for queries by password.
There is no decryption feature. In order to check a password match, you would write a SELECT statement like the following:
SELECT * FROM my_table
WHERE user_name = 'mads'
AND password_field = PASSWORD('test-password');