Are there any laws around expiration dates on purchased medicine

I’m stocking up on allergy medicine and just got some at Amazon. When the stuff arrived, it had an expiration date of Aug 2025, which was disappointing. I was wondering if there are any laws around this or if I can complain.

I might resort to only buying in store when I can see the exp date, which is a bit less convenient.