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 (
    2591, 1042, 1534, 41231, 5833, 31641, 
    400, 5835, 6089, 27363, 6562, 1781, 
    3885, 33716, 5836, 25733, 35734, 6068, 
    33717, 5507, 36781, 2563, 37305, 2566, 
    3384, 38146, 41435, 5505, 31643, 2415, 
    144, 2564
  ) 
  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.00521

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 (2591,1042,1534,41231,5833,31641,400,5835,6089,27363,6562,1781,3885,33716,5836,25733,35734,6068,33717,5507,36781,2563,37305,2566,3384,38146,41435,5505,31643,2415,144,2564)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
144 160000.0000
400 93636.0000
1042 400000.0000
1534 235000.0000
1781 999000.0000
2415 82000.0000
2563 85000.0000
2564 85000.0000
2566 400000.0000
2591 150000.0000
3384 189000.0000
3885 330000.0000
5505 70000.0000
5507 70000.0000
5833 211680.0000
5835 254880.0000
5836 216000.0000
6068 100000.0000
6089 610000.0000
6562 510000.0000
25733 162000.0000
27363 380000.0000
31641 35000.0000
31643 88000.0000
33716 2580000.0000
33717 2580000.0000
35734 1100000.0000
36781 1609000.0000
37305 248000.0000
38146 270000.0000
41231 320000.0000
41435 3749000.0000