Have you tried adding parentheses to force operator precedence?
SELECT product_id, small_jpg_path
FROM product
WHERE (motifcategory_id = 6)
AND (keyword_id LIKE '%,6,%'
OR keyword_id LIKE '%,22,%'
OR keyword_id LIKE '%,71,%')
AND (archive_id IN (295,294,296))
ORDER BY tif_path ASC
I think here's what the computer saw in your original form:
SELECT product_id, small_jpg_path
FROM product
WHERE (motifcategory_id = 6 AND keyword_id LIKE '%,6,%')
OR keyword_id LIKE '%,22,%'
OR (keyword_id LIKE '%,71,%' AND archive_id IN (295,294,296))
ORDER BY tif_path ASC
AND always gets validated before OR. I think you are dealing with a simple matter of operator precedence.