SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    507, 658, 659, 502, 1676, 1684, 1669, 
    508, 1670, 1677, 1685, 503, 660, 1678, 
    661, 339, 509, 1686, 1671, 504, 662, 
    1672, 505, 1679, 337, 510, 1613, 1673, 
    506, 1680, 1660, 1614, 1661, 1681, 1674, 
    1662, 1683, 1682, 1675, 1663, 1664, 
    1665, 1666, 1667, 1668
  ) 
  AND category_id != 264

Query time 0.00030

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.046397555,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "index",
          "possible_keys": ["PRIMARY", "parent", "p_category_id"],
          "key": "parent",
          "key_length": "3",
          "used_key_parts": ["parent_id"],
          "loops": 1,
          "rows": 271,
          "cost": 0.046397555,
          "filtered": 28.7822876,
          "attached_condition": "cscart_categories.parent_id in (507,658,659,502,1676,1684,1669,508,1670,1677,1685,503,660,1678,661,339,509,1686,1671,504,662,1672,505,1679,337,510,1613,1673,506,1680,1660,1614,1661,1681,1674,1662,1683,1682,1675,1663,1664,1665,1666,1667,1668) and cscart_categories.category_id <> 264",
          "using_index": true
        }
      }
    ]
  }
}

Result

category_id parent_id
502 337
503 337
504 337
505 337
506 337
507 339
508 339
509 339
510 339
659 658
660 658
661 658
662 658
1660 658
1661 658
1662 658
1663 658
1664 658
1665 658
1666 658
1667 658
1668 658
1669 1613
1670 1613
1671 1613
1672 1613
1673 1613
1674 1613
1675 1613
1676 1614
1677 1614
1678 1614
1679 1614
1680 1614
1681 1614
1682 1614
1684 1683
1685 1683
1686 1683