I need some advice on MySQL AES Encryption. I'm developing an application which connects to various 3rd-Party APIs and retrieves the Access Tokens for the application users. These Access Tokens are long-lived and will be used in offline mode for performing a bunch of tasks. My Question is that since Access Tokens have much privileges on a user's account, is it a good idea to store them using AES or some similar Encryption ? Is there any other better approach to secure these tokens?
Yes, it's a wise idea, but I'd recommend doing encryption in the application code and not in MySQL, because AES functions in MySQL are using ECB block mode, which is discouraged from being used in cryptographic systems.
To increase security, you could perform encryption/decryption in a HSM (hardware security module) or create a poor man's version of it with software. That way, the cryptographic material (e.g., master key) is more difficult to access.