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 (
    40437, 1896, 50216, 40451, 33725, 27361, 
    2320, 2319, 50194, 1893, 46822, 38074, 
    48846, 23152, 49873, 35279, 47084, 
    42255, 40350, 23158, 1057, 33723, 5715, 
    5716, 5717, 27359, 3517, 3516, 1103, 
    35782, 3518, 40445
  ) 
  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.00525

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": 32,
          "filtered": 99.9960556,
          "index_condition": "cscart_product_prices.product_id in (40437,1896,50216,40451,33725,27361,2320,2319,50194,1893,46822,38074,48846,23152,49873,35279,47084,42255,40350,23158,1057,33723,5715,5716,5717,27359,3517,3516,1103,35782,3518,40445)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
1057 320000.0000
1103 583000.0000
1893 878000.0000
1896 298000.0000
2319 400000.0000
2320 400000.0000
3516 169000.0000
3517 169000.0000
3518 169000.0000
5715 140000.0000
5716 140000.0000
5717 140000.0000
23152 199000.0000
23158 160000.0000
27359 430000.0000
27361 600000.0000
33723 2500000.0000
33725 2000000.0000
35279 275000.0000
35782 215000.0000
38074 540000.0000
40350 690000.0000
40437 180000.0000
40445 230000.0000
40451 460000.0000
42255 540000.0000
46822 450000.0000
47084 65000.0000
48846 540000.0000
49873 225000.0000
50194 180000.0000
50216 410000.0000