SELECT 
  cscart_product_prices.product_id, 
  COALESCE(
    cscart_master_products_storefront_min_price.price, 
    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 
  LEFT JOIN cscart_master_products_storefront_min_price ON cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id 
  AND cscart_master_products_storefront_min_price.storefront_id = 1 
WHERE 
  cscart_product_prices.product_id IN (
    3351, 78822, 3316, 3317, 2512, 3326, 
    3327, 3374, 3331, 3335, 3377, 3376, 
    3313, 3368, 3311, 3315, 3314, 3310, 
    3312, 3330, 3332, 3333, 3334, 3336, 
    3337, 3338, 3339, 3340, 3341, 3342, 
    3343, 3344, 3345, 3346, 3347, 3318, 
    3319, 3320, 3322, 3321, 3328, 3324, 
    3323, 3329, 3354, 3378, 3379, 3355, 
    3369, 3371, 3356, 3357, 3358, 3359, 
    3360, 3361, 3362, 3363, 3364, 3365, 
    3366, 3367, 3373, 3375
  ) 
  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.00442

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.263454463,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id",
            "wdbi_product_id_lower_limit_usergroup_id_price_eff1727beeef",
            "wdbi_usergroup_id_lower_limit_product_id_92b7e8f6a250",
            "wdbi_product_id_lower_limit_usergroup_id_price_perc_3b2301d551d0",
            "wdbi_lower_limit_usergroup_id_product_id_b93629431718"
          ],
          "key": "usergroup",
          "key_length": "9",
          "used_key_parts": ["product_id", "usergroup_id", "lower_limit"],
          "loops": 1,
          "rows": 128,
          "cost": 0.22335624,
          "filtered": 20,
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.product_id in (3351,78822,3316,3317,2512,3326,3327,3374,3331,3335,3377,3376,3313,3368,3311,3315,3314,3310,3312,3330,3332,3333,3334,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3318,3319,3320,3322,3321,3328,3324,3323,3329,3354,3378,3379,3355,3369,3371,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3373,3375) and cscart_product_prices.usergroup_id in (0,1)"
        }
      },
      {
        "table": {
          "table_name": "cscart_master_products_storefront_min_price",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "8",
          "used_key_parts": ["product_id", "storefront_id"],
          "ref": [
            "u985510652_ecartify_abhi.cscart_product_prices.product_id",
            "const"
          ],
          "loops": 25.6,
          "rows": 1,
          "cost": 0.023716864,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id)"
        }
      }
    ]
  }
}

Result

product_id price
2512 0.00000000
3310 360.00000000
3311 174.00000000
3312 255.00000000
3313 71.00000000
3314 86.00000000
3315 129.00000000
3316 0.00000000
3317 910.00000000
3318 174.00000000
3319 370.00000000
3320 560.00000000
3321 183.00000000
3322 192.00000000
3323 157.00000000
3324 86.00000000
3326 595.00000000
3327 595.00000000
3328 139.00000000
3329 228.00000000
3330 73.00000000
3331 16.00000000
3332 81.00000000
3333 86.00000000
3334 94.00000000
3335 18.00000000
3336 108.00000000
3337 108.00000000
3338 101.00000000
3339 108.00000000
3340 114.00000000
3341 128.00000000
3342 147.00000000
3343 143.00000000
3344 156.00000000
3345 199.00000000
3346 199.00000000
3347 275.00000000
3351 0.00000000
3354 40.00000000
3355 110.00000000
3356 360.00000000
3357 360.00000000
3358 360.00000000
3359 395.00000000
3360 395.00000000
3361 430.00000000
3362 430.00000000
3363 440.00000000
3364 460.00000000
3365 500.00000000
3366 580.00000000
3367 580.00000000
3368 49.00000000
3369 64.00000000
3371 58.00000000
3373 117.00000000
3374 260.00000000
3375 114.00000000
3376 114.00000000
3377 255.00000000
3378 209.00000000
3379 104.00000000
78822 10.00000000