Error!

MySQL Error: 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 'BOXES'_2013_CEW_WINNER' and locations.country='' ) and contents.id IN (select co' at line 1
SQL Statement: SELECT count(*) as total_records FROM contents WHERE contents.id IN(SELECT bgcompanies.id FROM bgcompanies,locations WHERE bgcompanies.display_address=locations.id AND locations.state='BIRCHBOX_'BOXES'_2013_CEW_WINNER' and locations.country='' ) and contents.id IN (select content_taxonomy.content_id from content_taxonomy where taxonomy_id=56310) and contents.publish_date <= '2016-05-28 11:02:49' and contents.published=1 and contents.magazine_id=8