Try this:
update yourtable a
inner join
(select product_id, min(price) minprice from
yourtable
group by product_id
) b
on a.product_id = b.product_id
inner join
(select product_id, price, min(id) minid from
yourtable
group by product_id, price
) c
on a.product_id = c.product_id and c.price = b.minprice
set defaultvalue = 1
where a.price = b.minprice
and a.id = c.minid
Demo here.
The second join
is used to get the minimum value of id
for the case where multiple records have lowest price
for same product_id
.