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(
    2, 17, 147, 148, 149, 13995, 13996, 13997, 
    13998, 13999, 14000, 14001, 14002, 
    14003, 14004, 14005, 14006, 14007, 
    14008, 14009, 14010, 14011, 14012, 
    14013, 14014, 14015, 14016, 14017, 
    14018, 14019, 14020, 14849, 14021, 
    14022, 14023, 14024, 14025, 14026, 
    14027, 14028, 14029, 14040, 14041, 
    14042, 14043, 14206, 14207, 14208, 
    14209, 14210, 14211, 14212, 14213, 
    14214, 14215, 14831, 14832, 14833, 
    14834, 14835, 14836, 14837, 14838, 
    14839, 14840, 14841, 14842, 14843, 
    14845, 15095, 15096, 15098, 15099, 
    15100, 15101, 15103, 15104, 15105, 
    15106, 15107, 15108, 15109, 15110, 
    15111, 15112, 15113, 15114, 15115, 
    15345
  ) 
  AND categories.company_id = 5370 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.00363

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "40.21"
    },
    "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": 89,
            "rows_produced_per_join": 0,
            "filtered": "0.06",
            "cost_info": {
              "read_cost": "40.14",
              "eval_cost": "0.01",
              "prefix_cost": "40.14",
              "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` = 5370) 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 (2,17,147,148,149,13995,13996,13997,13998,13999,14000,14001,14002,14003,14004,14005,14006,14007,14008,14009,14010,14011,14012,14013,14014,14015,14016,14017,14018,14019,14020,14849,14021,14022,14023,14024,14025,14026,14027,14028,14029,14040,14041,14042,14043,14206,14207,14208,14209,14210,14211,14212,14213,14214,14215,14831,14832,14833,14834,14835,14836,14837,14838,14839,14840,14841,14842,14843,14845,15095,15096,15098,15099,15100,15101,15103,15104,15105,15106,15107,15108,15109,15110,15111,15112,15113,15114,15115,15345)))"
          }
        },
        {
          "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.01",
              "eval_cost": "0.01",
              "prefix_cost": "40.16",
              "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": "40.21",
              "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
14017 14016 14016/14017 Aliah - The Daggers 0 A 5370 0 aliah-the-daggers 14016
15095 14849 14849/15095 Aliah - The Daggers 0 A 5370 0 aliah-the-daggers 14849
15096 14019 14019/15096 Alice - Bell | Dagger 0 A 5370 0 alice-bell-dagger 14019
14018 14016 14016/14018 Alley - Abstract Circles 0 A 5370 0 alley-abstract-circles 14016
14209 14849 14849/14209 Allison 0 A 5370 0 allison 14849
14210 14849 14849/14210 Amelia 0 A 5370 0 amelia 14849
14212 14849 14849/14212 Anna 0 A 5370 0 anna 14849
14043 14849 14849/14043 Annabelle 0 A 5370 0 annabelle 14849
13999 13996 13995/13996/13999 Aria - Scalloped Arch 0 A 5370 0 aria-scalloped-arch 13995/13996
14831 14849 14849/14831 Ashley - The Petal 0 A 5370 0 ashley-the-petal 14849
14022 14019 14019/14022 Aubree - Circle | Rounded Diamond 0 A 5370 0 aubree 14019
14013 14012 14012/14013 Ava - The Gem 0 A 5370 0 ava 14012
14213 14849 14849/14213 Avery 0 A 5370 0 avery 14849
14000 13997 13995/13997/14000 Brooklyn - Scalloped Arch & Scalloped Rainbow 0 A 5370 0 brooklyn-scalloped-arch-and-scalloped-rainbow 13995/13997
15098 13998 13995/13998/15098 Caroline - Scalloped Rainbow | Dagger | Scalloped Arch 0 A 5370 0 caroline-scalloped-rainbow-dagger-scalloped-arch 13995/13998
14023 14019 14019/14023 Charlotte - Circle | Dagger 0 A 5370 0 charlotte 14019
14833 14849 14849/14833 Chloe - The Circle 0 A 5370 0 chloe-the-circle 14849
14832 14019 14019/14832 Claire - Fan | Daggers 0 A 5370 0 claire-fan-daggers 14019
14001 13996 13995/13996/14001 Eleanor - Circle 0 A 5370 0 eleanor-circle 13995/13996
14024 14019 14019/14024 Elizabeth - Circle | Moon | Bell 0 A 5370 0 elizabeth 14019
15099 14016 14016/15099 Ella - Half Daisies 0 A 5370 0 ella-half-daisies 14016
14041 14020 14020/14041 Ellie 0 A 5370 0 ellie 14020
15100 14019 14019/15100 Emily - Circle | Imprinted Arch 0 A 5370 0 emily-circle-imprinted-arch 14019
15101 13998 13995/13998/15101 Emma - The Heart Pack 0 A 5370 0 emma-the-heart-pack 13995/13998
14042 14019 14019/14042 Eva - Abstract Circle | Shield 0 A 5370 0 eva 14019
14834 14019 14019/14834 Faith - Fan | Wide Dagger 0 A 5370 0 faith-fan-wide-dagger 14019
14021 14849 14849/14021 Gabriella - Lightning | Handmade Florals 0 A 5370 0 gabriella-lightning-handmade-florals 14849
14211 14849 14849/14211 Gianna 0 A 5370 0 gianna 14849
14002 13996 13995/13996/14002 Hadley - The "Pick" 0 A 5370 0 hadley-the-pick 13995/13996
14003 13997 13995/13997/14003 Hailey - The "Pick" Pack 0 A 5370 0 hailey-the-pick-pack 13995/13997
15103 14012 14012/15103 Harper - The Flower 0 A 5370 0 harper-the-flower 14012
14214 14020 14020/14214 Iris - Monstera Leaf 0 A 5370 0 iris 14020
15104 14019 14019/15104 Isabella - The Rounded Diamond Donut 0 A 5370 0 isabella-the-rounded-diamond-donut 14019
14835 14019 14019/14835 Jasmine - Circle | Lamp | Rainbow 0 A 5370 0 jasmine 14019
14215 14849 14849/14215 Jerelyn - The Coffee Lover 0 A 5370 0 jerelyn 14849
14014 14012 14012/14014 Julia - Classic Single Circles 0 A 5370 0 julia-classic-single-circles 14012
14025 14019 14019/14025 Katherine - Gem | Pointed Arch 0 A 5370 0 katherine 14019
15105 14019 14019/15105 Kaylee - The Lotus 0 A 5370 0 kaylee-the-lotus 14019
15106 14019 14019/15106 Kennedy - The Fans 0 A 5370 0 kennedy-the-fans 14019
14836 14019 14019/14836 Kylie - Teardrop | Imprinted Rainbow 0 A 5370 0 kylie 14019
14026 14019 14019/14026 Lauren - Abstract Arch | Shield 0 A 5370 0 lauren 14019
14027 14019 14019/14027 Layla - Hexagon | Teardrop | Bow 0 A 5370 0 layla 14019
15107 13997 13995/13997/15107 Leah - Daggers | Hearts 0 A 5370 0 leah-daggers-hearts 13995/13997
14837 14019 14019/14837 Lillian - Petal | Inverted Arch 0 A 5370 0 lillian-petal-inverted-arch 14019
14004 13997 13995/13997/14004 Lily - Scalloped Rainbow & Arch 0 A 5370 0 lily-scalloped-rainbow-and-arch 13995/13997
14839 14019 14019/14839 London - Circle | Circle Cut-Out 0 A 5370 0 london 14019
14040 14849 14849/14040 Lucy 0 A 5370 0 lucy 14849
14838 14019 14019/14838 Lydia - Teardrop | Imprinted Petals 0 A 5370 0 lydia 14019
14005 13997 13995/13997/14005 Mackenzie - Circle & Small Dagger 0 A 5370 0 mackenzie-circle-and-small-dagger 13995/13997
14006 13996 13995/13996/14006 Madelyn - Imprinted "Fan" 0 A 5370 0 madelyn-imprinted-fan 13995/13996
14208 14849 14849/14208 Madison 0 A 5370 0 madison 14849
14007 13998 13995/13998/14007 Mia - Single Color Circle, "Pick", & Heart 0 A 5370 0 mia-single-color-circle-pick-and-heart 13995/13998
14207 14849 14849/14207 Mila 0 A 5370 0 mila 14849
14840 14019 14019/14840 Naomi - Lamp | Long Archway 0 A 5370 0 naomi 14019
15108 14849 14849/15108 Natalie 0 A 5370 0 natalie 14849
14841 14019 14019/14841 Nora - Circle | Short Archway 0 A 5370 0 nora 14019
14842 14019 14019/14842 Olivia - Bell | Half Circles 0 A 5370 0 olivia 14019
14008 13996 13995/13996/14008 Paisley - Classic Arch 0 A 5370 0 paisley-classic-arch 13995/13996
15109 14019 14019/15109 Penelope 0 A 5370 0 penelope 14019
14015 14012 14012/14015 Peyton - The Bell 0 A 5370 0 peyton-the-bell 14012
14843 14019 14019/14843 Piper - Bell | Large Two Piece Circle 0 A 5370 0 piper 14019
14009 13997 13995/13997/14009 Rider - Circle & "Pick" Pack 0 A 5370 0 riley-circle-and-pick-pack 13995/13997
14206 14849 14849/14206 Ruby 0 A 5370 0 ruby 14849
14010 13996 13995/13996/14010 Ruthie - The Heart 0 A 5370 0 ruthie-the-heart 13995/13996
15110 14019 14019/15110 Ryleigh - The Bows 0 A 5370 0 ryleigh-the-bows 14019
14845 14019 14019/14845 Sadie - Circle | Teardrop 0 A 5370 0 sadie 14019
15114 13996 13995/13996/15114 Samantha - The Mini Daggers 0 A 5370 0 samantha-the-mini-daggers 13995/13996
15115 13997 13995/13997/15115 Savannah - Mini Hearts | Mini Daggers 0 A 5370 0 savannah-mini-hearts-mini-daggers 13995/13997
15111 14019 14019/15111 Skylar 0 A 5370 0 skylar 14019
15112 14019 14019/15112 Sophia 0 A 5370 0 sophia 14019
14011 13997 13995/13997/14011 Taylor - Classic Heart & "Pick" Pack 0 A 5370 0 taylor-circle-and-pick-pack 13995/13997
14028 14019 14019/14028 Victoria - Circle | Double Diamonds 0 A 5370 0 victoria 14019
15113 14849 14849/15113 Vivian - Daisy | Flower Vase 0 A 5370 0 vivian-daisy-flower-pot 14849
14029 14019 14019/14029 Zoey - Hexagon | Teardrop 0 A 5370 0 zoe 14019
13996 13995 13995/13996 Singles 1 A 5370 0 single-stud-pack 13995
13995 0 13995 Small Stud Earrings 1 A 5370 0 small-stud-earrings
14012 0 14012 Medium Stud Earrings 2 A 5370 0 medium-stud-earrings
13997 13995 13995/13997 Stud Pack - Two Pair 2 A 5370 0 stud-pack-two-pair 13995
14016 0 14016 Large Stud Earrings 3 A 5370 0 large-stud-earrings
13998 13995 13995/13998 Stud Pack - Three Pair 3 A 5370 0 stud-pack-three-pair 13995
14019 0 14019 Dangle Earrings - Stud Posts 4 A 5370 0 dangle-earrings-stud-posts
14849 0 14849 Dangle Earrings - Hooks 5 A 5370 0 dangle-earrings-hooks
14020 0 14020 Dangle Earrings - Hoops 6 A 5370 0 dangle-earrings-hoops-and-hooks