SELECT *
FROM users AS a,
     friendships AS b
WHERE a.userId      = b.passiveId AND
      b.activeId    = /*activeId*/0 AND
      a.foreignKey  = /*passiveId*/'' AND
      b.removedTime = 0
LIMIT 0, 1
