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 (5386, 5387, 5388, 5389, 5391)

Query time 0.00047

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.16"
    },
    "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": 5,
          "rows_produced_per_join": 5,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (5386,5387,5388,5389,5391))",
          "cost_info": {
            "read_cost": "3.01",
            "eval_cost": "0.50",
            "prefix_cost": "3.51",
            "data_read_per_join": "160"
          },
          "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": 5,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "3.16",
            "eval_cost": "0.50",
            "prefix_cost": "7.17",
            "data_read_per_join": "18K"
          },
          "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/5391_c5a300d059c1_higer-6109gl-1.webp 5391