(
    SELECT *
    FROM friendships
    WHERE activeId  = /*activeId*/0 AND
          passiveId = /*passiveId*/0
    LIMIT 0, 1
) UNION ALL (
    SELECT *
    FROM friendships
    WHERE activeId  = /*passiveId*/0 AND
          passiveId = /*activeId*/0
    LIMIT 0, 1
)