SELECT `p`.*
FROM `product` AS `p`
JOIN `attributes` AS `a1` ON `a1`.`object_id` = `p`.`id`
AND `a1`.`field_id` = :field1 AND `a1`.`value` = :value1
JOIN `attributes` AS `a2` ON `a2`.`object_id` = `p`.`id`
AND `a2`.`field_id` = :field2 AND `a2`.`value` = :value2