You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND spb_enabled = 1' at line 24
SELECT pr.productID as productID,
pr.categoryID as categoryID,
param_description,
in_stock,
ordering_available,
`name_ru` AS name,
`brief_description_ru` AS brief_description,
`brief_description_nnov_ru` AS brief_description_nnov,
`brief_description_ekb_ru` AS brief_description_ekb,
`brief_description_spb_ru` AS brief_description_spb,
`brief_description_perm_ru` AS brief_description_perm,
`brief_description_krr_ru` AS brief_description_krr,
`brief_description_nsk_ru` AS brief_description_nsk,
Price,
slug,
rel.text,
rel.background,
customers_rating,
rating_avg,
rating_cnt
FROM SC_products AS pr
JOIN SC_product_similar AS rel ON (rel.`relatedID` = pr.`productID`)
WHERE rel.productID=2818 AND pr.productID NOT IN (1271, 2193, 2194, 2200, 2196, 2228, 759, 760, 761, 762, 763, 764, 765, 766, 767, 2363, 2360, 2361, 2364, 2365, 2366, 2367, 2369) AND enabled = 1
ORDER BY in_stock DESC AND spb_enabled = 1