SELECT 
  PI.product_id, 
  F1.id AS file_id, 
  F1.path AS file, 
  (
    SELECT 
      PI1.alt 
    FROM 
      `cscart_products__images` PI1 
    WHERE 
      PI1.original_file_id = F1.id
  ) AS file_alt, 
  F2.id AS big_file_id, 
  F2.path AS big_file, 
  (
    SELECT 
      PI2.alt 
    FROM 
      `cscart_products__images` PI2 
    WHERE 
      PI2.watermark_big_file_id = F2.id
  ) AS big_file_alt, 
  F3.id AS small_file_id, 
  F3.path AS small_file, 
  (
    SELECT 
      PI3.alt 
    FROM 
      `cscart_products__images` PI3 
    WHERE 
      PI3.watermark_small_file_id = F3.id
  ) AS small_file_alt 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F1` ON `F1`.`id` = `PI`.`original_file_id` 
  LEFT JOIN `files` AS `F2` ON `F2`.`id` = `PI`.`watermark_big_file_id` 
  LEFT JOIN `files` AS `F3` ON `F3`.`id` = `PI`.`watermark_small_file_id` 
WHERE 
  `PI`.`product_id` = 30255

Query time 0.00176

Result

product_id file_id file file_alt big_file_id big_file big_file_alt small_file_id small_file small_file_alt
30255 367485 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_81054be77b5a_30256_c4a3fcafc61f_0_0ca300eb362e_IMG_4567.JPG 367486 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_36038cc8fc6a_30256_c4a3fcafc61f_0_0ca300eb362e_IMG_4567.webp 367487 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_5e2cf3d8765c_30256_c4a3fcafc61f_0_0ca300eb362e_IMG_4567.webp
30255 367488 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_9a72bd3d95a5_30256_8f8c83e6864c_0_dcb32df61b98_IMG_4569.JPG 367489 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_a9fe0628ea92_30256_8f8c83e6864c_0_dcb32df61b98_IMG_4569.webp 367490 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_5c00c79984c9_30256_8f8c83e6864c_0_dcb32df61b98_IMG_4569.webp
30255 367491 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_42cfc0d06e47_30256_31136dbd6462_0_d6f29d5f8c56_IMG_4571.JPG 367492 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_8394023ac3f7_30256_31136dbd6462_0_d6f29d5f8c56_IMG_4571.webp 367493 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_1b80b5a05870_30256_31136dbd6462_0_d6f29d5f8c56_IMG_4571.webp
30255 367494 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_50a43400a9d2_30256_2391ba6a2ca2_IMG_4579.JPG 367495 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_2782ef0219e5_30256_2391ba6a2ca2_IMG_4579.webp 367496 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_3fe06870625c_30256_2391ba6a2ca2_IMG_4579.webp
30255 367497 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_b2f4912332ef_30256_2f6240c7520b_IMG_4580.JPG 367498 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_23ece56c0f17_30256_2f6240c7520b_IMG_4580.webp 367499 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_ab5d9c6c715b_30256_2f6240c7520b_IMG_4580.webp
30255 367500 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_b90c8fada723_30256_b4ff90d8e257_IMG_4582.JPG 367501 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_d3e219c5c65d_30256_b4ff90d8e257_IMG_4582.webp 367502 https://s3.timeweb.cloud/482029f9-prod/products__images/30255_0a62864f075b_30256_b4ff90d8e257_IMG_4582.webp