SELECT 
  cscart_products_categories.product_id, 
  GROUP_CONCAT(
    IF(
      cscart_products_categories.link_type = "M", 
      CONCAT(
        cscart_products_categories.category_id, 
        "M"
      ), 
      cscart_products_categories.category_id
    )
  ) AS category_ids, 
  product_position_source.position AS position 
FROM 
  cscart_products_categories 
  INNER JOIN cscart_categories ON cscart_categories.category_id = cscart_products_categories.category_id 
  AND cscart_categories.company_id = 1 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  LEFT JOIN cscart_products_categories AS product_position_source ON cscart_products_categories.product_id = product_position_source.product_id 
  AND product_position_source.category_id = 1571 
WHERE 
  cscart_products_categories.product_id IN (
    64941, 62258, 60732, 60733, 60737, 64621, 
    61385, 64942, 60751, 60735, 64943, 
    64339, 63128, 60738, 62671, 64340, 
    61386, 64620, 64815, 65519, 65568, 
    65851, 65870, 65875, 65853, 65864, 
    65877, 65874, 65863, 65869, 65868, 
    65862, 65850, 65880, 65852, 65855, 
    65854, 65866, 65857, 65876, 65858, 
    65856, 65860, 65859, 65861
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00254

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "range",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "rows": 191,
      "filtered": 100,
      "attached_condition": "cscart_products_categories.product_id in (64941,62258,60732,60733,60737,64621,61385,64942,60751,60735,64943,64339,63128,60738,62671,64340,61386,64620,64815,65519,65568,65851,65870,65875,65853,65864,65877,65874,65863,65869,65868,65862,65850,65880,65852,65855,65854,65866,65857,65876,65858,65856,65860,65859,65861)",
      "using_index": true
    },
    "table": {
      "table_name": "product_position_source",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "PRIMARY",
      "key_length": "6",
      "used_key_parts": ["category_id", "product_id"],
      "ref": ["const", "cscart_migrate.cscart_products_categories.product_id"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["cscart_migrate.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "cscart_categories.company_id = 1 and (cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H')"
    }
  }
}

Result

product_id category_ids position
60732 1675,1916,1576M
60733 1675,1916,1576M
60735 1675,1916,1576M
60737 1675,1916,1576M
60738 1675,1916,1576M
60751 1675,1916,1576M
61385 1675,1916,1576M
61386 1675,1916,1576M
62258 1676,1917,1573M
62671 1676,1796,1917,1573M
63128 1675,1916,1576M
64339 1675,1916,1576M
64340 1675,1916,1576M
64620 1612,1839,1913,1575M
64621 1612,1839,1865,1913,1943,1575M
64815 1840,1918,1573M
64941 1759,1840,1918,1573M
64942 1758,1840,1918,1573M
64943 1757,1840,1918,1573M
65519 1840,1918,1573M
65568 1676,1917,1573M
65850 1575,1839,1865,1913,1943M
65851 1575,1839,1865,1913,1943M
65852 1575,1839,1865,1913,1943M
65853 1575,1839,1865,1913,1943M
65854 1575,1839,1865,1913,1943M
65855 1575,1839,1865,1913,1943M
65856 1575,1839,1865,1913,1943M
65857 1575,1839,1865,1913,1943M
65858 1575,1839,1865,1913,1943M
65859 1575,1839,1865,1913,1943M
65860 1575,1839,1865,1913,1943M
65861 1575,1839,1865,1913,1943M
65862 1575,1839,1865,1913,1943M
65863 1575,1839,1865,1913,1943M
65864 1575,1839,1865,1913,1943M
65866 1575,1839,1865,1913,1943M
65868 1575,1839,1865,1913,1943M
65869 1575,1839,1865,1913,1943M
65870 1575,1839,1865,1913,1943M
65874 1575,1839,1865,1913,1943M
65875 1575,1839,1865,1913,1943M
65876 1575,1839,1865,1913,1943M
65877 1575,1839,1865,1913,1943M
65880 1575,1839,1865,1913,1943M