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, 328, 310, 311, 312, 313, 
    314, 315, 316, 317, 318, 319, 320, 321, 
    327, 291, 292, 307, 296, 297, 293, 294, 
    308, 302, 306, 309, 298, 299, 300, 301, 
    295, 329, 326, 325, 324, 322, 323
  ) 
  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.00069

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": 39,
          "filtered": 97.31543732,
          "index_condition": "cscart_product_prices.product_id in (303,304,305,328,310,311,312,313,314,315,316,317,318,319,320,321,327,291,292,307,296,297,293,294,308,302,306,309,298,299,300,301,295,329,326,325,324,322,323)",
          "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
293 3.76000000
294 6.95000000
295 3.15000000
296 4.06000000
297 3.99000000
298 3.72000000
299 7.26000000
300 3.72000000
301 7.62000000
302 7.90000000
303 14.97000000
304 13.30000000
305 13.30000000
306 5.47000000
307 5.44000000
308 5.05000000
309 5.89000000
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
322 4.52000000
323 4.52000000
324 6.80000000
325 8.32000000
326 6.15000000
327 0.00000000
328 0.00000000
329 0.00000000