MySQL Error Occurred

Error Message:
1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and prod_flag=0 AND no_follow=0 and status=0 GROUP BY cubecart_inventory.pro...' at line 1

SQL:
SELECT cubecart_cats_idx.cat_id, cubecart_cats_idx.productId FROM cubecart_cats_idx INNER JOIN cubecart_inventory ON cubecart_cats_idx.productId = cubecart_inventory.productId WHERE cubecart_cats_idx.cat_id = and prod_flag=0 AND no_follow=0 and status=0 GROUP BY cubecart_inventory.productId ORDER BY `usa_imported` DESC,`productId` DESC