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 (
    4138, 4184, 5025, 4177, 4119, 4196, 4343, 
    4139, 4211, 4356, 4140, 4286, 4288, 
    4594, 4552, 4179, 4638, 4208, 4300, 
    4593, 4640, 4907, 4906, 4502, 4890, 
    4596, 4586
  ) 
  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.00160

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "18.91"
    },
    "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": 27,
        "rows_produced_per_join": 5,
        "filtered": "19.99",
        "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`product_id` in (4138,4184,5025,4177,4119,4196,4343,4139,4211,4356,4140,4286,4288,4594,4552,4179,4638,4208,4300,4593,4640,4907,4906,4502,4890,4596,4586))",
        "cost_info": {
          "read_cost": "18.37",
          "eval_cost": "0.54",
          "prefix_cost": "18.91",
          "data_read_per_join": "129"
        },
        "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
4119 10000.00000000
4138 78000.00000000
4139 15000.00000000
4140 45000.00000000
4177 34000.00000000
4179 22000.00000000
4184 20000.00000000
4196 25000.00000000
4208 42000.00000000
4211 54000.00000000
4286 15000.00000000
4288 32000.00000000
4300 165000.00000000
4343 13000.00000000
4356 245000.00000000
4502 160000.00000000
4552 118000.00000000
4586 305000.00000000
4593 120000.00000000
4594 108000.00000000
4596 260000.00000000
4638 16000.00000000
4640 67000.00000000
4890 8000.00000000
4906 47000.00000000
4907 26000.00000000
5025 27000.00000000