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 (
    389022, 388903, 391723, 389596, 388377, 
    388729, 389001, 389439, 390210, 388828, 
    389203, 415503, 388885, 388476, 415388, 
    388720, 388745, 415318, 389095, 389081
  ) 
  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.00127

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "56.07"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "usergroup",
        "used_key_parts": [
          "product_id",
          "usergroup_id",
          "lower_limit"
        ],
        "key_length": "9",
        "rows_examined_per_scan": 40,
        "rows_produced_per_join": 40,
        "filtered": "100.00",
        "cost_info": {
          "read_cost": "48.07",
          "eval_cost": "8.00",
          "prefix_cost": "56.07",
          "data_read_per_join": "2K"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`webmarco`.`cscart_product_prices`.`lower_limit` = 1) and (`webmarco`.`cscart_product_prices`.`product_id` in (389022,388903,391723,389596,388377,388729,389001,389439,390210,388828,389203,415503,388885,388476,415388,388720,388745,415318,389095,389081)) and (`webmarco`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
388377 65.14000000
388476 54.48000000
388720 113.90000000
388729 85.43000000
388745 198.10000000
388828 227.81000000
388885 328.10000000
388903 194.38000000
389001 638.00000000
389022 52.00000000
389081 80.48000000
389095 81.71000000
389203 153.90000000
389439 121.00000000
389596 130.29000000
390210 198.00000000
391723 205.71000000
415318 92.95000000
415388 95.90000000
415503 139.33000000