Since you are using mysql, you need to use joins (partition by is not supported):
The select:
select p.*
from products as p
join
(
select name, min(price) as price
from products group by name having count(price) = 2
) as p2 on p2.name = p.name and p2.price = p.price;
Gets the lowest price for all duplicate products (where duplicate assumes there are exactly two rows of the same product).
To delete, change the initial select to a delete, as follows:
delete p.*
from products as p
join
(
select name, min(price) as price
from products group by name having count(price) = 2
) as p2 on p2.name = p.name and p2.price = p.price;