MySQL Query with good execution plan is very slow due to Sending data operation
Saying "Sending data" merely points out how useless the Profiler often is.

This index on a might change the EXPLAIN (eg, start with a instead of b) and speed up things:

INDEX(`type`, `deleted`)  -- in either order


If you need further discussion, please provide SHOW CREATE TABLE and some clues of about how big each table is.

Why is b used?  Would you get the 'right' answer if you left out

INNER JOIN b ON a.borrowerId = b.id