SELECT 
  q_product_prices.product_id, 
  MIN(
    IF(
      q_product_prices.percentage_discount = 0, 
      q_product_prices.price, 
      q_product_prices.price - (
        q_product_prices.price * q_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  q_product_prices 
WHERE 
  q_product_prices.product_id IN (
    363, 364, 365, 366, 367, 368, 369, 370, 
    371, 372, 373, 374, 375, 376, 377, 378, 
    379, 380, 381, 382, 383, 384, 385, 386, 
    387, 388, 389, 390, 391, 392
  ) 
  AND q_product_prices.lower_limit = 1 
  AND q_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  q_product_prices.product_id

Query time 0.00073

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.01"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "q_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": 30,
        "rows_produced_per_join": 5,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392))",
        "cost_info": {
          "read_cost": "70.81",
          "eval_cost": "1.20",
          "prefix_cost": "72.01",
          "data_read_per_join": "143"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`portal`.`q_product_prices`.`lower_limit` = 1) and (`portal`.`q_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
363 125.000000
364 139.000000
365 159.000000
366 139.000000
367 295.000000
368 209.000000
369 119.000000
370 155.000000
371 229.000000
372 165.000000
373 219.000000
374 169.000000
375 225.000000
376 159.000000
377 179.000000
378 139.000000
379 235.000000
380 185.000000
381 195.000000
382 249.000000
383 149.000000
384 199.000000
385 285.000000
386 165.000000
387 179.000000
388 255.000000
389 145.000000
390 185.000000
391 255.000000
392 219.000000