Got error 122 from storage engine - 1030 - SQL:
SELECT cp.* FROM cart_products cp INNER JOIN cart_categories_products ccp USING(productid) WHERE ccp.categoryid = '1' AND available = 'Y' AND (SELECT COUNT(*) FROM cart_items WHERE productid = cp.productid AND quantity > 0) > 0 ORDER BY RAND() LIMIT 5