SELECT 
  product_prices.product_id, 
  MIN(
    IF(
      product_prices.percentage_discount = 0, 
      product_prices.price, 
      product_prices.price - (
        product_prices.price * product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  product_prices 
WHERE 
  product_prices.product_id IN (
    323729, 323745, 324475, 324479, 324489, 
    326336, 326389, 327714, 329001, 329002, 
    329026, 330320, 330348, 331082, 331092, 
    331657, 332936, 332946, 332959, 333756, 
    334264, 334281, 334310, 335049
  ) 
  AND product_prices.lower_limit = 1 
  AND product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  product_prices.product_id

Query time 0.00118

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "19.34"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "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": 2,
        "filtered": "10.00",
        "index_condition": "(`goimagine`.`product_prices`.`product_id` in (323729,323745,324475,324479,324489,326336,326389,327714,329001,329002,329026,330320,330348,331082,331092,331657,332936,332946,332959,333756,334264,334281,334310,335049))",
        "cost_info": {
          "read_cost": "19.10",
          "eval_cost": "0.24",
          "prefix_cost": "19.34",
          "data_read_per_join": "57"
        },
        "used_columns": [
          "id",
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`goimagine`.`product_prices`.`lower_limit` = 1) and (`goimagine`.`product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
323729 18.00000000
323745 18.00000000
324475 18.00000000
324479 18.00000000
324489 18.00000000
326336 20.00000000
326389 18.00000000
327714 18.00000000
329001 18.00000000
329002 18.00000000
329026 18.00000000
330320 15.00000000
330348 15.00000000
331082 18.00000000
331092 18.00000000
331657 18.00000000
332936 20.00000000
332946 15.00000000
332959 18.00000000
333756 18.00000000
334264 18.00000000
334281 18.00000000
334310 2.45000000
335049 18.00000000