See this fiddle and the aes_encrypt documentation.
What type is your pass
column? on the fiddle I defined it like:
pass varbinary(200)
Did this insert successfully:
INSERT INTO users (name, pass) VALUES ('Terry', aes_encrypt('32145', '32145'))
Then queried it like this:
select *
from users
where name = 'Terry' and pass = aes_encrypt('32145', '32145');
select *, aes_decrypt(pass, '32145')
from users
where pass = aes_encrypt('32145', '32145');
So your query should have worked.