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.storefront_id IN (0, 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 = 11 
WHERE 
  cscart_products_categories.product_id IN (
    1788, 1697, 1657, 1687, 1921, 1238, 1197, 
    1307, 1306, 1940, 1941, 1660, 1751, 
    1677, 1305, 1588, 1662, 1635, 1747, 
    1587, 1771, 1709, 1957, 1707, 1768, 
    1710, 1438, 1954, 1953, 1730, 1686, 
    1593, 1594, 1616, 1773, 1701, 1584, 
    1585, 1868, 1579, 1956, 1495, 1739, 
    1740, 1912, 1913, 1650, 56, 1836, 1336, 
    1837, 1820, 1304, 1738, 1893, 1895, 
    1894, 1641, 1500, 1317, 1670, 1658, 
    1669, 1558, 1644, 1262, 1552, 1398, 
    1595, 1576, 1870, 1691, 1776, 1785, 
    1633, 1563, 1564, 1667, 1786, 1945, 
    1910, 1787, 1308, 1642, 1772, 1736, 
    1277, 1672, 1325, 1665, 1778, 1775, 
    1671, 1649, 1909, 1948
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00322

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": 124,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (1788,1697,1657,1687,1921,1238,1197,1307,1306,1940,1941,1660,1751,1677,1305,1588,1662,1635,1747,1587,1771,1709,1957,1707,1768,1710,1438,1954,1953,1730,1686,1593,1594,1616,1773,1701,1584,1585,1868,1579,1956,1495,1739,1740,1912,1913,1650,56,1836,1336,1837,1820,1304,1738,1893,1895,1894,1641,1500,1317,1670,1658,1669,1558,1644,1262,1552,1398,1595,1576,1870,1691,1776,1785,1633,1563,1564,1667,1786,1945,1910,1787,1308,1642,1772,1736,1277,1672,1325,1665,1778,1775,1671,1649,1909,1948)"
    },
    "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": ["bacpvdev_db.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "cscart_categories.storefront_id in (0,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')"
    },
    "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", "bacpvdev_db.cscart_products_categories.product_id"],
      "rows": 1,
      "filtered": 100
    }
  }
}

Result

product_id category_ids position
56 13M
1197 13M
1238 13M
1262 13M
1277 13M
1304 13M
1305 13M
1306 13M
1307 13M
1308 13M
1317 13M
1325 13M
1336 13M
1398 13M
1438 11M 0
1495 13M
1500 13M
1552 13M
1558 13M
1563 13M
1564 13M
1576 13M
1579 13M
1584 13M
1585 13M
1587 13M
1588 13M
1593 13M
1594 13M
1595 13M
1616 13M
1633 13M
1635 13M
1641 13M
1642 13M
1644 13M
1649 13M
1650 13M
1657 13M
1658 13M
1660 13M
1662 13M
1665 13M
1667 13M
1669 25M
1670 13M
1671 13M
1672 13M
1677 13M
1686 13M
1687 13M
1691 13M
1697 13M
1701 13M
1707 13M
1709 13M
1710 13M
1730 13M
1736 13M
1738 13M
1739 13M
1740 13M
1747 13M
1751 13M
1768 13M
1771 13M
1772 13M
1773 13M
1775 13M
1776 13M
1778 13M
1785 13M
1786 13M
1787 13M
1788 13M
1820 13M
1836 13M
1837 13M
1868 13M
1870 13M
1893 13M
1894 13M
1895 13M
1909 13M
1910 13M
1912 13M
1913 13M
1921 13M
1940 13M
1941 13M
1945 13M
1948 13M
1953 13M
1954 13M
1956 13M
1957 13M