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 (
    5022, 5006, 3927, 4781, 3335, 4961, 5009, 
    3336, 5208, 3954, 3509, 3934, 3961, 
    4006, 5467, 5554, 3958, 5013, 3933, 
    5370, 8789, 3484, 5566, 4824, 4989, 
    5377, 3477, 4821, 5369, 4660, 5188, 
    5567, 4238, 3468, 4005, 4010, 5477, 
    4292, 5866, 5374
  ) 
  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.00154

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "28.01"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "product_id",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "3",
        "rows_examined_per_scan": 40,
        "rows_produced_per_join": 7,
        "filtered": "19.99",
        "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`product_id` in (5022,5006,3927,4781,3335,4961,5009,3336,5208,3954,3509,3934,3961,4006,5467,5554,3958,5013,3933,5370,8789,3484,5566,4824,4989,5377,3477,4821,5369,4660,5188,5567,4238,3468,4005,4010,5477,4292,5866,5374))",
        "cost_info": {
          "read_cost": "27.21",
          "eval_cost": "0.80",
          "prefix_cost": "28.01",
          "data_read_per_join": "191"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`lower_limit` = 1) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
3335 6550000.00000000
3336 7100000.00000000
3468 395000.00000000
3477 495000.00000000
3484 945000.00000000
3509 665000.00000000
3927 30000.00000000
3933 60000.00000000
3934 60000.00000000
3954 72000.00000000
3958 60000.00000000
3961 102000.00000000
4005 240000.00000000
4006 282000.00000000
4010 240000.00000000
4238 66000.00000000
4292 180000.00000000
4660 103000.00000000
4781 162000.00000000
4821 195000.00000000
4824 252000.00000000
4961 599250.00000000
4989 499000.00000000
5006 13950.00000000
5009 13950.00000000
5013 13950.00000000
5022 13950.00000000
5188 35000.00000000
5208 8250.00000000
5369 710000.00000000
5370 710000.00000000
5374 825000.00000000
5377 1025000.00000000
5467 945000.00000000
5477 1520000.00000000
5554 35000.00000000
5566 2750000.00000000
5567 1815000.00000000
5866 390000.00000000
8789 119000.00000000