The following would seem to offer what you are looking for:
SELECT s.`word`
FROM `synonyms` s
LEFT JOIN `synonyms_relations` sr1 ON sr1.word1_id = s.id
LEFT JOIN `synonyms` s1 ON s1.id = sr1.word2_id
LEFT JOIN `synonyms_relations` sr2 ON sr2.word2_id = s.id
LEFT JOIN `synonyms` s2 ON s2.id = sr2.word1_id
WHERE (s1.`word` = 'car' OR s2.`word` = 'car')
Effectively, joining all words that have a matching word2_id
(via sr1
and s1
) and all words that have a matching word1_id
(via sr2
and s2
).