SELECT tag.* FROM tags AS tag
INNER JOIN tags AS tag1 ON tag.item_id = tag1.item_id
INNER JOIN tags AS tag2 ON tag.item_id = tag2.item_id
WHERE tag1.tag_key = 'Цвет' AND tag1.tag_value = 'Красный' AND tag2.tag_key = 'Скорость' AND tag2.tag_value != '500'
SELECT object_id, GROUP_CONCAT(option_id) AS temp FROM object_option WHERE option_id IN (1, 2) GROUP BY object_id HAVING temp = '1,2'