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 (
    8171, 8172, 7786, 8173, 8174, 9392, 9390, 
    9393, 9394, 9529, 9580, 9585, 9391, 
    10084, 9578, 9582, 9588, 9694, 10062, 
    10063, 10079, 9579, 9581, 9583
  ) 
  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.00125

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "16.81"
    },
    "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": 24,
        "rows_produced_per_join": 4,
        "filtered": "19.99",
        "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`product_id` in (8171,8172,7786,8173,8174,9392,9390,9393,9394,9529,9580,9585,9391,10084,9578,9582,9588,9694,10062,10063,10079,9579,9581,9583))",
        "cost_info": {
          "read_cost": "16.33",
          "eval_cost": "0.48",
          "prefix_cost": "16.81",
          "data_read_per_join": "115"
        },
        "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
7786 116000.00000000
8171 103000.00000000
8172 167750.00000000
8173 103250.00000000
8174 71000.00000000
9390 24000.00000000
9391 33000.00000000
9392 34000.00000000
9393 34000.00000000
9394 34000.00000000
9529 33000.00000000
9578 88000.00000000
9579 116000.00000000
9580 88000.00000000
9581 67250.00000000
9582 115000.00000000
9583 67250.00000000
9585 80000.00000000
9588 67250.00000000
9694 64000.00000000
10062 145000.00000000
10063 145000.00000000
10079 41000.00000000
10084 61000.00000000