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 (
    6151, 
    5696, 
    2698, 
    5721, 
    5621, 
    5724, 
    3605, 
    5944, 
    4951, 
    5830, 
    2340, 
    5887, 
    3354, 
    3155, 
    3834, 
    2737, 
    3308, 
    5892, 
    3306, 
    5848, 
    3397, 
    2352, 
    2431, 
    5934, 
    3841, 
    5114, 
    2339, 
    3212, 
    3389, 
    2924, 
    1626, 
    3350, 
    4163, 
    3392, 
    6098, 
    5811, 
    3390, 
    4934, 
    2862, 
    5719, 
    4960, 
    5706, 
    5720, 
    4933, 
    5850, 
    5821, 
    2922, 
    5849, 
    5828, 
    5703, 
    5832, 
    5824, 
    5798, 
    3603, 
    2693, 
    3928, 
    2338, 
    5826, 
    5801, 
    5864, 
    5829, 
    3301, 
    5852, 
    4894, 
    3660, 
    5928, 
    5822, 
    5847, 
    5854, 
    5896, 
    2341, 
    5794, 
    2702, 
    3147, 
    6099, 
    3828, 
    5898, 
    5788, 
    5932, 
    3649, 
    3520, 
    3529, 
    4962, 
    1668, 
    3146, 
    4958, 
    4942, 
    3809, 
    8586, 
    3518, 
    3148, 
    3918, 
    8372, 
    3215, 
    3213, 
    2222, 
    3400, 
    5691, 
    5687, 
    3733, 
    3552, 
    2805, 
    3232, 
    4915, 
    6025, 
    3149, 
    3416, 
    3157, 
    3589, 
    5791, 
    3845, 
    3150, 
    2481, 
    3822, 
    4976, 
    3115, 
    3740, 
    3123, 
    2228, 
    3743, 
    3112, 
    3944, 
    3664, 
    3126, 
    2230, 
    2655, 
    3741, 
    5683, 
    3440, 
    5890, 
    2226, 
    5859, 
    3843, 
    3840, 
    3130, 
    3811, 
    3441, 
    6054, 
    2221, 
    5891, 
    3153, 
    3924, 
    3377, 
    2522, 
    2719, 
    6041, 
    5111, 
    3385, 
    5948, 
    8240, 
    3551, 
    3831, 
    5927, 
    3289, 
    10078, 
    3382, 
    3519, 
    3356, 
    6093, 
    6194
  ) 
  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.00238

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "112.01"
    },
    "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": 160,
        "rows_produced_per_join": 31,
        "filtered": "19.99",
        "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_product_prices`.`product_id` in (6151,5696,2698,5721,5621,5724,3605,5944,4951,5830,2340,5887,3354,3155,3834,2737,3308,5892,3306,5848,3397,2352,2431,5934,3841,5114,2339,3212,3389,2924,1626,3350,4163,3392,6098,5811,3390,4934,2862,5719,4960,5706,5720,4933,5850,5821,2922,5849,5828,5703,5832,5824,5798,3603,2693,3928,2338,5826,5801,5864,5829,3301,5852,4894,3660,5928,5822,5847,5854,5896,2341,5794,2702,3147,6099,3828,5898,5788,5932,3649,3520,3529,4962,1668,3146,4958,4942,3809,8586,3518,3148,3918,8372,3215,3213,2222,3400,5691,5687,3733,3552,2805,3232,4915,6025,3149,3416,3157,3589,5791,3845,3150,2481,3822,4976,3115,3740,3123,2228,3743,3112,3944,3664,3126,2230,2655,3741,5683,3440,5890,2226,5859,3843,3840,3130,3811,3441,6054,2221,5891,3153,3924,3377,2522,2719,6041,5111,3385,5948,8240,3551,3831,5927,3289,10078,3382,3519,3356,6093,6194))",
        "cost_info": {
          "read_cost": "108.81",
          "eval_cost": "3.20",
          "prefix_cost": "112.01",
          "data_read_per_join": "767"
        },
        "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
1626 182000.00000000
1668 74000.00000000
2221 65000.00000000
2222 39000.00000000
2226 22000.00000000
2228 19000.00000000
2230 14000.00000000
2338 40000.00000000
2339 24000.00000000
2340 7000.00000000
2341 12000.00000000
2352 12000.00000000
2431 9000.00000000
2481 38000.00000000
2522 51000.00000000
2655 11000.00000000
2693 13000.00000000
2698 11000.00000000
2702 15000.00000000
2719 18000.00000000
2737 23000.00000000
2805 54000.00000000
2862 282000.00000000
2922 18000.00000000
2924 19000.00000000
3112 171000.00000000
3115 177000.00000000
3123 18000.00000000
3126 25000.00000000
3130 28000.00000000
3146 5000.00000000
3147 6000.00000000
3148 7000.00000000
3149 8000.00000000
3150 10000.00000000
3153 13000.00000000
3155 16000.00000000
3157 21000.00000000
3212 4000.00000000
3213 6000.00000000
3215 12000.00000000
3232 15000.00000000
3289 17000.00000000
3301 21000.00000000
3306 21000.00000000
3308 21000.00000000
3350 25000.00000000
3354 28000.00000000
3356 31000.00000000
3377 65000.00000000
3382 15000.00000000
3385 10000.00000000
3389 25000.00000000
3390 20000.00000000
3392 67000.00000000
3397 15000.00000000
3400 15000.00000000
3416 40000.00000000
3440 9000.00000000
3441 9000.00000000
3518 7000.00000000
3519 11000.00000000
3520 12000.00000000
3529 15000.00000000
3551 31000.00000000
3552 28000.00000000
3589 47000.00000000
3603 19000.00000000
3605 13000.00000000
3649 10000.00000000
3660 7500.00000000
3664 5000.00000000
3733 7500.00000000
3740 6000.00000000
3741 6000.00000000
3743 6000.00000000
3809 12000.00000000
3811 8000.00000000
3822 17000.00000000
3828 23000.00000000
3831 25000.00000000
3834 25000.00000000
3840 28000.00000000
3841 28000.00000000
3843 28000.00000000
3845 31000.00000000
3918 89000.00000000
3924 14000.00000000
3928 18000.00000000
3944 60000.00000000
4163 33000.00000000
4894 70000.00000000
4915 70000.00000000
4933 128000.00000000
4934 129000.00000000
4942 89000.00000000
4951 367000.00000000
4958 215000.00000000
4960 295000.00000000
4962 70000.00000000
4976 70000.00000000
5111 7000.00000000
5114 6000.00000000
5621 120000.00000000
5683 134000.00000000
5687 120000.00000000
5691 148000.00000000
5696 88000.00000000
5703 148000.00000000
5706 70000.00000000
5719 70000.00000000
5720 70000.00000000
5721 134000.00000000
5724 134000.00000000
5788 29000.00000000
5791 65000.00000000
5794 75000.00000000
5798 35000.00000000
5801 49000.00000000
5811 69000.00000000
5821 185000.00000000
5822 122000.00000000
5824 118000.00000000
5826 85000.00000000
5828 185000.00000000
5829 63000.00000000
5830 86000.00000000
5832 140000.00000000
5847 33000.00000000
5848 35000.00000000
5849 50000.00000000
5850 40000.00000000
5852 48000.00000000
5854 35000.00000000
5859 19000.00000000
5864 122000.00000000
5887 84000.00000000
5890 91000.00000000
5891 52000.00000000
5892 120000.00000000
5896 160000.00000000
5898 49000.00000000
5927 229000.00000000
5928 114000.00000000
5932 180000.00000000
5934 229000.00000000
5944 69000.00000000
5948 69000.00000000
6025 134000.00000000
6041 69000.00000000
6054 69000.00000000
6093 82000.00000000
6098 46000.00000000
6099 60000.00000000
6151 134000.00000000
6194 70000.00000000
8240 24000.00000000
8372 17000.00000000
8586 59000.00000000
10078 7000.00000000