Как вам такой MySQL запрос? Не будет ли она сильно нагружать БД? Как его можно оптимизировать?
SELECT users.id, name, birthday, sex, city, status, regdate, last_activity_at
FROM users
INNER JOIN photos on users.id=photos.uid
LEFT JOIN blacklist bl ON bl.who = users.id AND bl.uid = 93
LEFT JOIN blacklist bl2 ON bl2.uid = users.id AND bl2.who = 93
WHERE address != "" and users.id != 93 and last_activity_at > 1545059524 and blocked=0 and deleted=0 and city=1 and sex=2
and bl.id IS NULL AND bl2.id IS NULL
GROUP BY users.id
ORDER BY (birthday >= 796089600 and birthday <= 1111449600) DESC, status=0 DESC, users.id DESC
LIMIT 0,1