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 (
    1278, 2289, 3289, 1102, 3871, 1104, 1979, 
    41293, 17259, 398, 1981, 40446, 5278, 
    855, 5786, 47020, 41339, 1580, 3876, 
    1975, 48980, 120, 40443, 27353, 37850, 
    43824, 2873, 3577, 2854, 1538, 3713, 
    41590
  ) 
  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.00908

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 (1278,2289,3289,1102,3871,1104,1979,41293,17259,398,1981,40446,5278,855,5786,47020,41339,1580,3876,1975,48980,120,40443,27353,37850,43824,2873,3577,2854,1538,3713,41590)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
120 95000.0000
398 68000.0000
855 1680000.0000
1102 990000.0000
1104 583000.0000
1278 1600000.0000
1538 295000.0000
1580 150000.0000
1975 240000.0000
1979 68688.0000
1981 27540.0000
2289 50000.0000
2854 350000.0000
2873 300000.0000
3289 297000.0000
3577 119000.0000
3713 399000.0000
3871 490000.0000
3876 170000.0000
5278 38880.0000
5786 264000.0000
17259 206000.0000
27353 550000.0000
37850 79000.0000
40443 180000.0000
40446 230000.0000
41293 450000.0000
41339 310000.0000
41590 180000.0000
43824 250000.0000
47020 550000.0000
48980 450000.0000