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 (
    3587, 5549, 34671, 27863, 2964, 31640, 
    40440, 3586, 45507, 389, 1713, 44422, 
    2278, 3874, 2514, 2287, 5569, 46751, 
    6059, 48769, 31630, 6060, 4440, 18258, 
    14822, 18201, 2461, 31909, 31908, 2505, 
    4441, 6099
  ) 
  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.01002

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 (3587,5549,34671,27863,2964,31640,40440,3586,45507,389,1713,44422,2278,3874,2514,2287,5569,46751,6059,48769,31630,6060,4440,18258,14822,18201,2461,31909,31908,2505,4441,6099)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
389 50000.0000
1713 95000.0000
2278 150000.0000
2287 40000.0000
2461 104500.0000
2505 110000.0000
2514 50000.0000
2964 75000.0000
3586 119000.0000
3587 119000.0000
3874 170000.0000
4440 25000.0000
4441 25000.0000
5549 195000.0000
5569 60000.0000
6059 75000.0000
6060 80000.0000
6099 50000.0000
14822 165000.0000
18201 183600.0000
18258 25000.0000
27863 25000.0000
31630 42000.0000
31640 119000.0000
31908 100000.0000
31909 100000.0000
34671 49000.0000
40440 180000.0000
44422 103680.0000
45507 110000.0000
46751 190000.0000
48769 99000.0000