You're timing out because you're using inefficient nested subqueries.
This will perform better:
EDIT: Per your last comment, this query will return you firmalar
records that have no notlar
records added since '2013-03-24'... it then joins those results on musterisahipleri
and notlar
again to get associated reps and notes (if applicable)
SELECT *
FROM (
SELECT f.*
FROM firmalar AS f
LEFT JOIN musterisahipleri AS m
ON m.firmaID = f.firmaID
LEFT JOIN notlar AS n
ON n.ilgiliID = m.userID
AND n.eklemeTarihi > '2013-03-24'
GROUP BY f.firmaID
HAVING MAX(n.ilgiliID) IS NULL
) AS f
LEFT JOIN musterisahipleri AS m
ON m.firmaID = f.firmaID
LEFT JOIN notlar AS n
ON n.ilgiliID = m.userID
You should also ensure you have indexes on the columns you're joining on, e.g.
ALTER TABLE firmalar ADD INDEX (firmaID);
ALTER TABLE musterisahipleri ADD INDEX (firmaID);
ALTER TABLE musterisahipleri ADD INDEX (userID);
ALTER TABLE notlar ADD INDEX (ilgiliID);