AES_ENCRYPT() is a MySql function for encrypting sensitive data, like passwords.
Usage examples:

SELECT AES_ENCRYPT("string","secret_key");
UPDATE `users` SET `encr_password` = AES_ENCRYPT("string", "secret_key");

The encrypted string will be binary, so it cannot be stored in a regular text field or varchar in MySql.
So, in this case:

UPDATE `users` SET `encr_password` = AES_ENCRYPT("string", "secret_key");

If `encr_password` field’s type is varchar or text then it will contain only the representation of a few binary codes that match ascii characters and this cannot be decrypted successfully.
If `encr_password` field’s type is BLOB then the password will be stored successfully.

You can decrypt the password using the AES_DECRYPT function.
Usage example:

UPDATE `users` SET `regular_password` = AES_DECRYPT("password", "secret_key")

In this case the regular password can be stored in a varchar or text field.

The “secret_key” used in these examples is a key that is used in creating the crypt hash.
You should use the same key for encrypting as for decrypting otherwise it will fail.