SELECT 
  cscart_product_prices.product_id, 
  MIN(
    IF(
      cscart_product_prices.percentage_discount = 0, 
      cscart_product_prices.price, 
      cscart_product_prices.price - (
        cscart_product_prices.price * cscart_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  cscart_product_prices 
WHERE 
  cscart_product_prices.product_id IN (
    303, 304, 305, 310, 311, 312, 313, 314, 
    315, 316, 317, 318, 319, 320, 321, 291, 
    292, 307, 296, 297
  ) 
  AND cscart_product_prices.lower_limit = 1 
  AND cscart_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  cscart_product_prices.product_id

Query time 0.00044

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id"
          ],
          "key": "product_id",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "rows": 20,
          "filtered": 97.31543732,
          "index_condition": "cscart_product_prices.product_id in (303,304,305,310,311,312,313,314,315,316,317,318,319,320,321,291,292,307,296,297)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
291 4.75000000
292 8.77000000
296 4.06000000
297 3.99000000
303 14.97000000
304 13.30000000
305 13.30000000
307 5.44000000
310 12.80000000
311 24.62000000
312 9.19000000
313 17.28000000
314 8.81000000
315 17.05000000
316 8.81000000
317 17.05000000
318 8.20000000
319 15.80000000
320 10.48000000
321 10.48000000