MySQL AES加密性能下降

I'm hosting a port forwarded server on my computer. For a school assignment, I am trying to make a login page on my computer.

I set up my database and PHP script to validate my passwords and everything using AES_ENCRYPT() and AES_DECRYPT().

In Chrome, I launched the actual PHP script on localhost and the response performance I got for validating some sample data was excellent (the table has barely five rows right now).

However, in the actual site, I need to access this script using an AJAX request. As soon as I submit the request, the website freezes, and I have to close out the tab and try all over again (the tab doesn't refresh).

Why is this happening? I am using the POST method to send my data.