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 (
    31639, 31631, 22172, 47024, 1278, 3570, 
    3569, 31636, 1088, 1979, 17259, 398, 
    1981, 40446, 31637, 5278, 5786, 47020, 
    31635, 1580, 1975, 48980, 40443, 27353, 
    37850, 2873, 3577, 2854, 3713, 1538, 
    41590, 2290
  ) 
  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.10050

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "cscart_product_prices.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_product_prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "lower_limit",
              "key_length": "3",
              "used_key_parts": ["lower_limit"],
              "ref": ["const"],
              "rows": 25327,
              "filtered": 8.333330154,
              "attached_condition": "cscart_product_prices.lower_limit <=> 1 and cscart_product_prices.product_id in (31639,31631,22172,47024,1278,3570,3569,31636,1088,1979,17259,398,1981,40446,31637,5278,5786,47020,31635,1580,1975,48980,40443,27353,37850,2873,3577,2854,3713,1538,41590,2290) and cscart_product_prices.usergroup_id in (0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id price
398 68000.0000
1088 180000.0000
1278 1600000.0000
1538 295000.0000
1580 150000.0000
1975 240000.0000
1979 68688.0000
1981 27540.0000
2290 170000.0000
2854 350000.0000
2873 300000.0000
3569 129000.0000
3570 129000.0000
3577 119000.0000
3713 399000.0000
5278 38880.0000
5786 264000.0000
17259 206000.0000
22172 280000.0000
27353 550000.0000
31631 49000.0000
31635 110000.0000
31636 175000.0000
31637 135000.0000
31639 35000.0000
37850 79000.0000
40443 180000.0000
40446 230000.0000
41590 180000.0000
47020 550000.0000
47024 550000.0000
48980 450000.0000