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 (
    40437, 40451, 49487, 49539, 47084, 40442, 
    40446, 40443, 40449, 40448, 40447, 
    40444, 40436, 40450, 40438, 40441, 
    40439, 40434, 40440, 634, 48826, 294, 
    48772, 39612, 36304, 635, 636, 48827, 
    31953
  ) 
  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.00651

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": 29,
          "filtered": 99.9960556,
          "index_condition": "cscart_product_prices.product_id in (40437,40451,49487,49539,47084,40442,40446,40443,40449,40448,40447,40444,40436,40450,40438,40441,40439,40434,40440,634,48826,294,48772,39612,36304,635,636,48827,31953)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
294 260000.0000
634 42000.0000
635 95000.0000
636 85000.0000
31953 90000.0000
36304 70000.0000
39612 180000.0000
40434 180000.0000
40436 180000.0000
40437 180000.0000
40438 180000.0000
40439 180000.0000
40440 180000.0000
40441 180000.0000
40442 180000.0000
40443 180000.0000
40444 180000.0000
40446 230000.0000
40447 230000.0000
40448 230000.0000
40449 230000.0000
40450 230000.0000
40451 460000.0000
47084 65000.0000
48772 59000.0000
48826 75000.0000
48827 55000.0000
49487 245000.0000
49539 130000.0000