MySql GROUP BY, ORDER BY LIMIT query taking more than 5000 seconds
I would try an index for:

location, abc_key, a_time


If you want to stretch that a bit and create a covering index

location, abc_key, a_time, val


Hovever, a table without a primary key is a bit suspicious. In fact, nothing is mandatory. You may want to investiga why this is so, and if possible fix