SELECT 
  categories.category_id, 
  categories.parent_id, 
  categories.id_path, 
  category_descriptions.category, 
  categories.position, 
  categories.status, 
  categories.company_id, 
  categories.storefront_id, 
  seo_names.name as seo_name, 
  seo_names.path as seo_path, 
  category_descriptions.mega_m_category_banner_url, 
  category_descriptions.mega_m_category_svg_icon 
FROM 
  categories 
  LEFT JOIN category_descriptions ON categories.category_id = category_descriptions.category_id 
  AND category_descriptions.lang_code = 'en' 
  LEFT JOIN seo_names ON seo_names.object_id = categories.category_id 
  AND seo_names.type = 'c' 
  AND seo_names.dispatch = '' 
  AND seo_names.lang_code = 'en' 
WHERE 
  1 = 1 
  AND (
    categories.usergroup_ids = '' 
    OR FIND_IN_SET(0, categories.usergroup_ids) 
    OR FIND_IN_SET(1, categories.usergroup_ids)
  ) 
  AND categories.status IN ('A') 
  AND categories.storefront_id IN (0, 1) 
  AND categories.deleted_at IS NULL 
  AND categories.category_id IN(
    3, 4, 14, 20, 21, 22, 45, 46, 48, 52, 12, 
    59, 71, 72, 84, 85, 86, 109, 110, 112, 
    118, 130, 2, 19, 157, 178, 47, 218, 236, 
    125, 270, 334, 357, 367, 380, 383, 388, 
    20087, 395, 543, 544, 545, 547, 548, 
    550, 552, 553, 555, 557, 558, 559, 561, 
    563, 565, 566, 1812, 1813, 51, 6638, 
    8281, 8282, 8284, 8285, 8662, 13340
  ) 
  AND categories.company_id = 138 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.00200

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "29.39"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id",
              "index_categories_on_deleted_at"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 65,
            "rows_produced_per_join": 0,
            "filtered": "0.08",
            "cost_info": {
              "read_cost": "29.31",
              "eval_cost": "0.01",
              "prefix_cost": "29.32",
              "data_read_per_join": "134"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "company_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "deleted_at",
              "storefront_id"
            ],
            "attached_condition": "((`goimagine`.`categories`.`company_id` = 138) and ((`goimagine`.`categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`categories`.`usergroup_ids`))) and (`goimagine`.`categories`.`status` = 'A') and (`goimagine`.`categories`.`storefront_id` in (0,1)) and (`goimagine`.`categories`.`deleted_at` is null) and (`goimagine`.`categories`.`category_id` in (3,4,14,20,21,22,45,46,48,52,12,59,71,72,84,85,86,109,110,112,118,130,2,19,157,178,47,218,236,125,270,334,357,367,380,383,388,20087,395,543,544,545,547,548,550,552,553,555,557,558,559,561,563,565,566,1812,1813,51,6638,8281,8282,8284,8285,8662,13340)))"
          }
        },
        {
          "table": {
            "table_name": "category_descriptions",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "goimagine.categories.category_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.02",
              "eval_cost": "0.01",
              "prefix_cost": "29.34",
              "data_read_per_join": "232"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category",
              "mega_m_category_banner_url",
              "mega_m_category_svg_icon"
            ]
          }
        },
        {
          "table": {
            "table_name": "seo_names",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "dispatch"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "object_id",
              "type",
              "dispatch",
              "lang_code"
            ],
            "key_length": "206",
            "ref": [
              "goimagine.categories.category_id",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.04",
              "eval_cost": "0.01",
              "prefix_cost": "29.39",
              "data_read_per_join": "86"
            },
            "used_columns": [
              "name",
              "object_id",
              "company_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id storefront_id seo_name seo_path mega_m_category_banner_url mega_m_category_svg_icon
544 0 544 Clothing 0 A 138 0 clothing-en
543 0 543 Accessories 0 A 138 0 accessories-en
1812 0 1812 All Products 0 A 138 0 all-products-en-15
552 543 543/552 Bags 0 A 138 0 bags 543
563 545 545/563 Bath 0 A 138 0 bath 545
561 545 545/561 Blankets 0 A 138 0 blankets 545
8285 8282 8282/8285 Clothing 0 A 138 0 clothing 8282
1813 0 1813 Custom Order 0 A 138 0 custom-order
565 545 545/565 Decor 0 A 138 0 decor 545
553 543 543/553 Feet / Legs 0 A 138 0 feet-legs 543
8662 0 8662 Gifts Under $20 0 A 138 0 gifts-under-20
555 543 543/555 Hats 0 A 138 0 hats 543
8284 8282 8282/8284 Hats/Gloves/Scarves 0 A 138 0 hats-gloves-scarves 8282
557 543 543/557 Headbands 0 A 138 0 headbands 543
547 0 547 Holiday 0 A 138 0 holiday
545 0 545 Home 0 A 138 0 home
8282 0 8282 Kids 0 A 138 0 kids-en-2
566 545 545/566 Kitchen 0 A 138 0 kitchen 545
13340 545 545/13340 Outdoor 0 A 138 0 outdoor 545
8281 0 8281 Pets 0 A 138 0 pets-en-7
558 543 543/558 Scarves 0 A 138 0 scarves 543
559 544 544/559 Shawls / Wraps 0 A 138 0 shawls-wraps 544
550 544 544/550 Sweaters 0 A 138 0 sweaters 544
548 0 548 Toys / Novelties 0 A 138 0 toys-novelties