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 (
    38750, 31914, 48179, 4172, 859, 4171, 
    4170, 2801, 28127, 2761, 862, 6187, 
    4016, 6086, 4180, 4175, 6084, 31919, 
    227, 35377, 230, 33185, 31917, 6087, 
    4274, 2054, 1549, 506, 2800, 31915, 
    507, 3837
  ) 
  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.00560

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 (38750,31914,48179,4172,859,4171,4170,2801,28127,2761,862,6187,4016,6086,4180,4175,6084,31919,227,35377,230,33185,31917,6087,4274,2054,1549,506,2800,31915,507,3837)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
227 300000.0000
230 320000.0000
506 75000.0000
507 30000.0000
859 90000.0000
862 120000.0000
1549 495000.0000
2054 231000.0000
2761 280000.0000
2800 160000.0000
2801 220000.0000
3837 84700.0000
4016 59000.0000
4170 175000.0000
4171 175000.0000
4172 175000.0000
4175 155000.0000
4180 85000.0000
4274 130000.0000
6084 110000.0000
6086 170000.0000
6087 130000.0000
6187 180000.0000
28127 60000.0000
31914 150000.0000
31915 150000.0000
31917 250000.0000
31919 150000.0000
33185 200000.0000
35377 130000.0000
38750 30000.0000
48179 220000.0000