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 (
    38074, 6357, 5503, 17265, 5990, 34555, 
    31638, 31633, 31632, 5300, 5991, 5297, 
    1980, 1103, 31634, 31631, 1102, 31636, 
    1104, 1979, 17259, 398, 1981, 1716, 
    31637, 5278, 1277, 31635, 1580, 121, 
    120, 43824
  ) 
  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.00279

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 (38074,6357,5503,17265,5990,34555,31638,31633,31632,5300,5991,5297,1980,1103,31634,31631,1102,31636,1104,1979,17259,398,1981,1716,31637,5278,1277,31635,1580,121,120,43824)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
120 95000.0000
121 69000.0000
398 68000.0000
1102 990000.0000
1103 583000.0000
1104 583000.0000
1277 120000.0000
1580 150000.0000
1716 249000.0000
1979 68688.0000
1980 22032.0000
1981 27540.0000
5278 38880.0000
5297 552000.0000
5300 552000.0000
5503 70000.0000
5990 79000.0000
5991 82000.0000
6357 300000.0000
17259 206000.0000
17265 206000.0000
31631 49000.0000
31632 55000.0000
31633 135000.0000
31634 135000.0000
31635 110000.0000
31636 175000.0000
31637 135000.0000
31638 135000.0000
34555 40000.0000
38074 540000.0000
43824 250000.0000