How to optimize query with having and group
If you dont have it already, you could create a index on both fields: is_first and lead_id; 



If it's a table with few record you won't see much difference, so I always recommend to check the statistics from the query.