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 (
    'gift_certificate', 'free_products', 
    'quick_view', 'gift_certificate', 
    'edit', 'gift_certificate', 'gift_cert_to', 
    'gift_cert_from', 'amount', 'send_via', 
    'postal_mail', 'free_products', 
    'product', 'price', 'quantity', 'subtotal', 
    'price_summary', 'gift_certificate', 
    'free_products', 'quick_view', 'gift_certificate', 
    'edit', 'gift_certificate', 'gift_cert_to', 
    'gift_cert_from', 'amount', 'send_via', 
    'postal_mail', 'free_products', 
    'product', 'price', 'quantity', 'subtotal', 
    'price_summary'
  )

Query time 0.00121

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": 14,
      "filtered": 100,
      "index_condition": "lang.lang_code = 'vi' and lang.`name` in ('gift_certificate','free_products','quick_view','gift_certificate','edit','gift_certificate','gift_cert_to','gift_cert_from','amount','send_via','postal_mail','free_products','product','price','quantity','subtotal','price_summary','gift_certificate','free_products','quick_view','gift_certificate','edit','gift_certificate','gift_cert_to','gift_cert_from','amount','send_via','postal_mail','free_products','product','price','quantity','subtotal','price_summary')"
    }
  }
}

Result

name value
amount Số lượng
edit Biên tập
free_products Sản phẩm miễn phí
gift_certificate Giấy chứng nhận quà tặng
gift_cert_from Từ
gift_cert_to ĐẾN
postal_mail Thư bưu điện
price Giá
price_summary Tóm tắt giá
product Sản phẩm
quantity Số lượng
quick_view Xem nhanh
send_via Gửi qua
subtotal Tổng phụ