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 (
    295774, 303250, 308376, 316325, 317505, 
    319376, 325547, 325710, 325715, 322000, 
    6276, 19341, 119170, 142807, 162962, 
    164053, 180420, 220516, 238478, 242500, 
    263871, 295549, 295825, 317507
  ) 
  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.00148

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "21.63"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "usergroup",
        "used_key_parts": [
          "product_id",
          "usergroup_id",
          "lower_limit"
        ],
        "key_length": "9",
        "rows_examined_per_scan": 48,
        "rows_produced_per_join": 48,
        "filtered": "100.00",
        "cost_info": {
          "read_cost": "16.83",
          "eval_cost": "4.80",
          "prefix_cost": "21.63",
          "data_read_per_join": "1K"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`unicomps`.`cscart_product_prices`.`lower_limit` = 1) and (`unicomps`.`cscart_product_prices`.`product_id` in (295774,303250,308376,316325,317505,319376,325547,325710,325715,322000,6276,19341,119170,142807,162962,164053,180420,220516,238478,242500,263871,295549,295825,317507)) and (`unicomps`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
6276 14743.86000000
19341 9140.14000000
119170 27251.47000000
142807 3249.70000000
162962 1183.54000000
164053 1208.71000000
180420 19170.00000000
220516 24485.33000000
238478 1706.62000000
242500 7479.26000000
263871 222096.84000000
295549 36142.29000000
295774 420.00000000
295825 684.00000000
303250 49495.19000000
308376 7260.55000000
316325 49987.67000000
317505 559.80000000
317507 525.11000000
319376 1488.56000000
322000 18972.58000000
325547 100403.28000000
325710 30318.59000000
325715 31115.92000000