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 (
    387039, 339692, 339737, 339535, 339534, 
    339573, 339496, 339617, 339620, 339621, 
    339742, 339611, 339533, 339710, 81689, 
    339587, 339683, 339444, 170248, 387094, 
    339722, 387042, 339570, 339610, 81674, 
    339584, 339771, 170250, 435270, 339638, 
    159865, 339625, 339706, 339529, 339751, 
    387037, 339736, 173787, 339618, 254333, 
    265275, 387092, 339569, 339581, 339615, 
    159861, 339770, 387040, 339705, 339608, 
    205885, 339619, 254332, 258305, 339783, 
    339693, 391684, 339732, 339779, 339759, 
    339607, 170249, 339572, 159863, 254325, 
    159864, 339775, 170247, 339476, 339589, 
    339652, 339571, 254327, 339778, 391687, 
    387089, 170216, 387056, 173789, 391688, 
    387096, 387093, 170251, 387041, 173763, 
    339738, 339456, 339686, 339550, 391689, 
    387098, 339780, 339739, 387045, 339644, 
    339747, 339586, 339630, 391800, 387044
  ) 
  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.00267

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "280.31"
    },
    "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": 200,
        "rows_produced_per_join": 200,
        "filtered": "100.00",
        "cost_info": {
          "read_cost": "240.31",
          "eval_cost": "40.00",
          "prefix_cost": "280.31",
          "data_read_per_join": "12K"
        },
        "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 (387039,339692,339737,339535,339534,339573,339496,339617,339620,339621,339742,339611,339533,339710,81689,339587,339683,339444,170248,387094,339722,387042,339570,339610,81674,339584,339771,170250,435270,339638,159865,339625,339706,339529,339751,387037,339736,173787,339618,254333,265275,387092,339569,339581,339615,159861,339770,387040,339705,339608,205885,339619,254332,258305,339783,339693,391684,339732,339779,339759,339607,170249,339572,159863,254325,159864,339775,170247,339476,339589,339652,339571,254327,339778,391687,387089,170216,387056,173789,391688,387096,387093,170251,387041,173763,339738,339456,339686,339550,391689,387098,339780,339739,387045,339644,339747,339586,339630,391800,387044)) and (`webmarco`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
81674 0.00000000
81689 0.00000000
159861 0.00000000
159863 0.00000000
159864 0.00000000
159865 0.00000000
170216 0.00000000
170247 0.00000000
170248 0.00000000
170249 0.00000000
170250 0.00000000
170251 0.00000000
173763 0.00000000
173787 0.00000000
173789 0.00000000
205885 0.00000000
254325 0.00000000
254327 0.00000000
254332 0.00000000
254333 0.00000000
258305 16.57000000
265275 0.00000000
339444 7.00000000
339456 90.00000000
339476 32.00000000
339496 55.00000000
339529 65.00000000
339533 220.00000000
339534 270.00000000
339535 325.00000000
339550 7.00000000
339569 12.00000000
339570 16.00000000
339571 0.00000000
339572 58.00000000
339573 58.00000000
339581 4.00000000
339584 4.00000000
339586 45.00000000
339587 85.00000000
339589 45.00000000
339607 60.00000000
339608 65.00000000
339610 26.00000000
339611 65.00000000
339615 45.00000000
339617 55.00000000
339618 11.00000000
339619 100.00000000
339620 30.00000000
339621 160.00000000
339625 38.00000000
339630 25.00000000
339638 16.00000000
339644 13.00000000
339652 18.00000000
339683 26.00000000
339686 90.00000000
339692 4.00000000
339693 16.00000000
339705 32.00000000
339706 170.00000000
339710 40.00000000
339722 70.00000000
339732 60.00000000
339736 29.50000000
339737 68.00000000
339738 12.00000000
339739 69.00000000
339742 98.00000000
339747 8.50000000
339751 20.00000000
339759 290.00000000
339770 210.00000000
339771 3.90000000
339775 3.50000000
339778 25.00000000
339779 34.00000000
339780 27.00000000
339783 115.00000000
387037 0.00000000
387039 0.00000000
387040 0.00000000
387041 0.00000000
387042 0.00000000
387044 0.00000000
387045 0.00000000
387056 0.00000000
387089 0.00000000
387092 0.00000000
387093 0.00000000
387094 0.00000000
387096 0.00000000
387098 0.00000000
391684 0.00000000
391687 0.00000000
391688 0.00000000
391689 0.00000000
391800 0.00000000
435270 0.00000000