UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WFaToc9QHXxBHDL79Y57xjBJiEAkCOrZASElCEPbZow=' 
WHERE 
  key_id = '473af07e401042ad9ff13e5c878f79763759258a50ab12831cd181e43d32858e' 
  AND (
    token = 'WFaToc9QHXxBHDL79Y57xjBJiEAkCOrZASElCEPbZow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041