SELECT *
FROM (((`wp_posts` p
INNER JOIN `wp_term_relationships` tr ON p.ID = tr.object_id)
INNER JOIN `wp_term_taxonomy` tt ON tr.term_taxonomy_id = tt.term_taxonomy_id)
INNER JOIN `wp_terms` t ON FIND_IN_SET(t.term_id, br_get_parent_cat(tt.term_id)))
WHERE post_type = 'product' AND taxonomy = 'product_cat' AND t.name LIKE '%Категория3%'