SELECT 
  `F`.`path`, 
  `PI`.`product_id`, 
  `PI`.`alt` 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F` ON `PI`.`watermark_small_file_id` = `F`.`id` 
WHERE 
  `PI`.`product_id` IN (
    '5391', '5388', '5386', '5390', '5387', 
    '5389'
  )

Query time 0.00040

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "8.57"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "PI",
          "access_type": "range",
          "possible_keys": [
            "product_id"
          ],
          "key": "product_id",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "rows_examined_per_scan": 6,
          "rows_produced_per_join": 6,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in ('5391','5388','5386','5390','5387','5389'))",
          "cost_info": {
            "read_cost": "3.61",
            "eval_cost": "0.60",
            "prefix_cost": "4.21",
            "data_read_per_join": "192"
          },
          "used_columns": [
            "product_id",
            "watermark_small_file_id",
            "alt"
          ]
        }
      },
      {
        "table": {
          "table_name": "F",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "4",
          "ref": [
            "dev2.PI.watermark_small_file_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 6,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "3.76",
            "eval_cost": "0.60",
            "prefix_cost": "8.57",
            "data_read_per_join": "22K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/5386_1187054f419b_20210112162000840.webp 5386
https://s3.timeweb.cloud/482029f9-prod/products__images/5387_4e4ad236795c_615_original.webp 5387
https://s3.timeweb.cloud/482029f9-prod/products__images/5388_332671240866_hv92je-%D1%81%D0%B0%D0%B9%D1%82%D0%B0-new.webp 5388
https://s3.timeweb.cloud/482029f9-prod/products__images/5389_11aa0ca389f3_20210121152954670.webp 5389
https://s3.timeweb.cloud/482029f9-prod/products__images/5390_a430d3ab1d02_6826-2.webp 5390
https://s3.timeweb.cloud/482029f9-prod/products__images/5391_c5a300d059c1_higer-6109gl-1.webp 5391