SELECT 
  lang.name, 
  IF(
    cscart_ult_language_values.value IS NULL, 
    lang.value, cscart_ult_language_values.value
  ) as value 
FROM 
  cscart_language_values lang 
  LEFT JOIN cscart_ult_language_values ON cscart_ult_language_values.name = lang.name 
  AND company_id = 1 
  AND cscart_ult_language_values.lang_code = lang.lang_code 
WHERE 
  lang.lang_code = 'vi' 
  AND lang.name IN (
    'social_buttons.facebook_cookie_title', 
    'social_buttons.facebook_cookie_description', 
    'social_buttons.pinterest_cookie_title', 
    'social_buttons.pinterest_cookie_description', 
    'social_buttons.twitter_cookie_title', 
    'social_buttons.twitter_cookie_description', 
    'social_buttons.vkontakte_cookie_title', 
    'social_buttons.vkontakte_cookie_description', 
    'social_buttons.yandex_cookie_title', 
    'social_buttons.yandex_cookie_description', 
    'social_buttons.facebook_cookie_title', 
    'social_buttons.facebook_cookie_description', 
    'social_buttons.pinterest_cookie_title', 
    'social_buttons.pinterest_cookie_description', 
    'social_buttons.twitter_cookie_title', 
    'social_buttons.twitter_cookie_description', 
    'social_buttons.vkontakte_cookie_title', 
    'social_buttons.vkontakte_cookie_description', 
    'social_buttons.yandex_cookie_title', 
    'social_buttons.yandex_cookie_description'
  )

Query time 0.00106

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_ult_language_values",
      "access_type": "system",
      "possible_keys": ["PRIMARY"],
      "rows": 0,
      "filtered": 0,
      "const_row_not_found": true
    },
    "table": {
      "table_name": "lang",
      "access_type": "range",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "392",
      "used_key_parts": ["lang_code", "name"],
      "rows": 10,
      "filtered": 100,
      "index_condition": "lang.lang_code = 'vi' and lang.`name` in ('social_buttons.facebook_cookie_title','social_buttons.facebook_cookie_description','social_buttons.pinterest_cookie_title','social_buttons.pinterest_cookie_description','social_buttons.twitter_cookie_title','social_buttons.twitter_cookie_description','social_buttons.vkontakte_cookie_title','social_buttons.vkontakte_cookie_description','social_buttons.yandex_cookie_title','social_buttons.yandex_cookie_description','social_buttons.facebook_cookie_title','social_buttons.facebook_cookie_description','social_buttons.pinterest_cookie_title','social_buttons.pinterest_cookie_description','social_buttons.twitter_cookie_title','social_buttons.twitter_cookie_description','social_buttons.vkontakte_cookie_title','social_buttons.vkontakte_cookie_description','social_buttons.yandex_cookie_title','social_buttons.yandex_cookie_description')"
    }
  }
}

Result

name value
social_buttons.facebook_cookie_description Cookie Facebook kích hoạt chức năng liên quan đến Facebook, chẳng hạn như nút Facebook trên trang sản phẩm. Đây là <a href="https://www.facebook.com/about/privacy/previous" target="_blank">Chính sách quyền riêng tư của Facebook</a>.
social_buttons.facebook_cookie_title Facebook
social_buttons.pinterest_cookie_description Cookie Pinterest kích hoạt chức năng liên quan đến Pinterest, chẳng hạn như nút Pinterest trên trang sản phẩm. Đây là <a href="https://policy.pinterest.com/en/privacy-policy" target="_blank">Chính sách bảo mật của Pinterest</a>.
social_buttons.pinterest_cookie_title Pinterest
social_buttons.twitter_cookie_description Cookie Twitter kích hoạt chức năng liên quan đến Twitter, chẳng hạn như nút Twitter trên trang sản phẩm. Đây là <a href="https://twitter.com/en/privacy" target="_blank">Chính sách quyền riêng tư của Twitter</a>.
social_buttons.twitter_cookie_title Twitter
social_buttons.vkontakte_cookie_description Cookie VK kích hoạt chức năng liên quan đến VK, chẳng hạn như nút VK trên trang sản phẩm. Đây là <a href="https://m.vk.com/privacy" target="_blank">Chính sách quyền riêng tư của VK</a>.
social_buttons.vkontakte_cookie_title VK
social_buttons.yandex_cookie_description Yandex giúp chúng tôi hiển thị các nút của nhiều mạng xã hội (ví dụ: trên các trang sản phẩm). Đây là <a href="https://yandex.com/legal/confidential/" target="_blank">Chính sách quyền riêng tư của Yandex</a>.
social_buttons.yandex_cookie_title Yandex