SELECT 
  categories.category_id, 
  categories.parent_id, 
  categories.id_path, 
  category_descriptions.category, 
  categories.position, 
  categories.status, 
  categories.company_id 
FROM 
  categories 
  LEFT JOIN category_descriptions ON categories.category_id = category_descriptions.category_id 
  AND category_descriptions.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.level <= 3 
  AND categories.deleted_at IS NULL 
  AND categories.company_id = 5370 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.04105

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1151.51"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "categories",
            "access_type": "ref",
            "possible_keys": [
              "c_status",
              "index_categories_on_deleted_at"
            ],
            "key": "index_categories_on_deleted_at",
            "used_key_parts": [
              "deleted_at"
            ],
            "key_length": "6",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 10182,
            "rows_produced_per_join": 33,
            "filtered": "0.33",
            "index_condition": "(`goimagine`.`categories`.`deleted_at` is null)",
            "cost_info": {
              "read_cost": "120.75",
              "eval_cost": "3.39",
              "prefix_cost": "1138.95",
              "data_read_per_join": "88K"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "level",
              "company_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "deleted_at"
            ],
            "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`.`level` <= 3))"
          }
        },
        {
          "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": 33,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "9.16",
              "eval_cost": "3.39",
              "prefix_cost": "1151.51",
              "data_read_per_join": "154K"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id
14017 14016 14016/14017 Aliah - The Daggers 0 A 5370
15095 14849 14849/15095 Aliah - The Daggers 0 A 5370
15096 14019 14019/15096 Alice - Bell | Dagger 0 A 5370
14018 14016 14016/14018 Alley - Abstract Circles 0 A 5370
14209 14849 14849/14209 Allison 0 A 5370
14210 14849 14849/14210 Amelia 0 A 5370
14212 14849 14849/14212 Anna 0 A 5370
14043 14849 14849/14043 Annabelle 0 A 5370
13999 13996 13995/13996/13999 Aria - Scalloped Arch 0 A 5370
14831 14849 14849/14831 Ashley - The Petal 0 A 5370
14022 14019 14019/14022 Aubree - Circle | Rounded Diamond 0 A 5370
14013 14012 14012/14013 Ava - The Gem 0 A 5370
14213 14849 14849/14213 Avery 0 A 5370
15097 14019 14019/15097 Avery - Rounded Diamond | Imprinted Rainbow 0 A 5370
14000 13997 13995/13997/14000 Brooklyn - Scalloped Arch & Scalloped Rainbow 0 A 5370
15098 13998 13995/13998/15098 Caroline - Scalloped Rainbow | Dagger | Scalloped Arch 0 A 5370
14023 14019 14019/14023 Charlotte - Circle | Dagger 0 A 5370
14833 14849 14849/14833 Chloe - The Circle 0 A 5370
14832 14019 14019/14832 Claire - Fan | Daggers 0 A 5370
14001 13996 13995/13996/14001 Eleanor - Circle 0 A 5370
14024 14019 14019/14024 Elizabeth - Circle | Moon | Bell 0 A 5370
15099 14016 14016/15099 Ella - Half Daisies 0 A 5370
14041 14020 14020/14041 Ellie 0 A 5370
15100 14019 14019/15100 Emily - Circle | Imprinted Arch 0 A 5370
15101 13998 13995/13998/15101 Emma - The Heart Pack 0 A 5370
14042 14019 14019/14042 Eva - Abstract Circle | Shield 0 A 5370
14834 14019 14019/14834 Faith - Fan | Wide Dagger 0 A 5370
14021 14849 14849/14021 Gabriella - Lightning | Handmade Florals 0 A 5370
14211 14849 14849/14211 Gianna 0 A 5370
15102 13996 13995/13996/15102 Grace - Scalloped Rainbow 0 A 5370
14002 13996 13995/13996/14002 Hadley - The "Pick" 0 A 5370
14003 13997 13995/13997/14003 Hailey - The "Pick" Pack 0 A 5370
15103 14012 14012/15103 Harper - The Flower 0 A 5370
14214 14020 14020/14214 Iris - Monstera Leaf 0 A 5370
15104 14019 14019/15104 Isabella - The Rounded Diamond Donut 0 A 5370
14835 14019 14019/14835 Jasmine - Circle | Lamp | Rainbow 0 A 5370
14215 14849 14849/14215 Jerelyn - The Coffee Lover 0 A 5370
14014 14012 14012/14014 Julia - Classic Single Circles 0 A 5370
14025 14019 14019/14025 Katherine - Gem | Pointed Arch 0 A 5370
15105 14019 14019/15105 Kaylee - The Lotus 0 A 5370
15106 14019 14019/15106 Kennedy - The Fans 0 A 5370
14836 14019 14019/14836 Kylie - Teardrop | Imprinted Rainbow 0 A 5370
14026 14019 14019/14026 Lauren - Abstract Arch | Shield 0 A 5370
14027 14019 14019/14027 Layla - Hexagon | Teardrop | Bow 0 A 5370
15107 13997 13995/13997/15107 Leah - Daggers | Hearts 0 A 5370
14837 14019 14019/14837 Lillian - Petal | Inverted Arch 0 A 5370
14004 13997 13995/13997/14004 Lily - Scalloped Rainbow & Arch 0 A 5370
14839 14019 14019/14839 London - Circle | Circle Cut-Out 0 A 5370
14040 14849 14849/14040 Lucy 0 A 5370
14838 14019 14019/14838 Lydia - Teardrop | Imprinted Petals 0 A 5370
14005 13997 13995/13997/14005 Mackenzie - Circle & Small Dagger 0 A 5370
14006 13996 13995/13996/14006 Madelyn - Imprinted "Fan" 0 A 5370
14208 14849 14849/14208 Madison 0 A 5370
14007 13998 13995/13998/14007 Mia - Single Color Circle, "Pick", & Heart 0 A 5370
14207 14849 14849/14207 Mila 0 A 5370
14840 14019 14019/14840 Naomi - Lamp | Long Archway 0 A 5370
15108 14849 14849/15108 Natalie 0 A 5370
14841 14019 14019/14841 Nora - Circle | Short Archway 0 A 5370
14842 14019 14019/14842 Olivia - Bell | Half Circles 0 A 5370
14008 13996 13995/13996/14008 Paisley - Classic Arch 0 A 5370
15109 14019 14019/15109 Penelope 0 A 5370
14015 14012 14012/14015 Peyton - The Bell 0 A 5370
14843 14019 14019/14843 Piper - Bell | Large Two Piece Circle 0 A 5370
14009 13997 13995/13997/14009 Rider - Circle & "Pick" Pack 0 A 5370
14206 14849 14849/14206 Ruby 0 A 5370
14010 13996 13995/13996/14010 Ruthie - The Heart 0 A 5370
15110 14019 14019/15110 Ryleigh - The Bows 0 A 5370
14845 14019 14019/14845 Sadie - Circle | Teardrop 0 A 5370
15114 13996 13995/13996/15114 Samantha - The Mini Daggers 0 A 5370
15115 13997 13995/13997/15115 Savannah - Mini Hearts | Mini Daggers 0 A 5370
15111 14019 14019/15111 Skylar 0 A 5370
15112 14019 14019/15112 Sophia 0 A 5370
14011 13997 13995/13997/14011 Taylor - Classic Heart & "Pick" Pack 0 A 5370
14028 14019 14019/14028 Victoria - Circle | Double Diamonds 0 A 5370
15113 14849 14849/15113 Vivian - Daisy | Flower Vase 0 A 5370
14029 14019 14019/14029 Zoey - Hexagon | Teardrop 0 A 5370
13996 13995 13995/13996 Singles 1 A 5370
13995 0 13995 Small Stud Earrings 1 A 5370
14012 0 14012 Medium Stud Earrings 2 A 5370
13997 13995 13995/13997 Stud Pack - Two Pair 2 A 5370
14016 0 14016 Large Stud Earrings 3 A 5370
13998 13995 13995/13998 Stud Pack - Three Pair 3 A 5370
14019 0 14019 Dangle Earrings - Stud Posts 4 A 5370
14849 0 14849 Dangle Earrings - Hooks 5 A 5370
14020 0 14020 Dangle Earrings - Hoops 6 A 5370