SELECT 
  * 
FROM 
  cscart_bm_locations as l 
  LEFT JOIN cscart_bm_locations_descriptions as d ON d.location_id = l.location_id 
  AND d.lang_code = 'kk' 
WHERE 
  l.layout_id = 12 
  AND l.dispatch IN ('products.view') 
  AND (
    FIND_IN_SET(12565, l.object_ids) 
    OR l.object_ids = ''
  ) 
ORDER BY 
  l.object_ids desc 
LIMIT 
  1

Query time 0.00041

JSON explain

{
  "query_block": {
    "select_id": 1,
    "read_sorted_file": {
      "filesort": {
        "sort_key": "l.object_ids desc",
        "table": {
          "table_name": "l",
          "access_type": "ALL",
          "rows": 231,
          "filtered": 100,
          "attached_condition": "l.layout_id = 12 and l.dispatch = 'products.view' and (find_in_set(12565,l.object_ids) or l.object_ids = '')"
        }
      }
    },
    "table": {
      "table_name": "d",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "10",
      "used_key_parts": ["location_id", "lang_code"],
      "ref": ["noframes_angrybeaver.l.location_id", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(d.location_id = l.location_id and d.lang_code = 'kk')"
    }
  }
}

Result

location_id dispatch is_default layout_id object_ids custom_html position user_class lang_code name title meta_description meta_keywords
236 products.view 0 12 1931,1932,1933,1957,1958,1959,1967,5384,5400,5401,5402,5403,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5423,5424,5425,5426,5462,5463,5464,5465,5466,5501,5517,5562,5748,5895,5904,5905,5906,6099,6100,6101,6149,6174,6236,6239,6240,6241,6250,6251,6252,6262,6282,6295,6316,6317,6399,6400,6401,6402,6403,6404,6405,6419,6420,6423,6424,6425,6427,6428,6429,6430,6431,6432,6433,6434,6435,6469,6470,6472,6473,6474,6475,6476,6477,6478,6562,6611,6612,6613,6616,6645,6646,6647,6676,6683,6774,6822,6824,6825,6826,6827,6828,6829,6838,6839,6840,6841,6842,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6863,6866,6867,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6917,6918,6919,6920,6923,12548,12534,12535,12536,12537,12538,12539,12540,12541,12542,12543,12544,12545,12546,12547,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12665,12666,12667,12668,12669,12670,13091,15759,15778,15800,15925,15938 440 kk Ковры