Speed up ORDER BY and LIMIT in MySQL
This composite index may help:

INDEX(account_id, lastname)


When adding it, you may as well remove INDEX(account_id), since it will then be redundant.

This may be even better, but I am not sure:

INDEX(deleted, account_id, lastname)


However it does not supersede INDEX(account_id).