SELECT DISTINCT t.term_id, tr.object_id
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('barrcats', 'aop_cat') AND tr.object_id IN (4170, 5265, 4191, 4186, 4169, 4182, 4166, 4161, 5396, 5633)
ORDER BY t.name ASC