UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kB9fHYSfnqtRhoUoZVsbJ/z0sMBzPOflyEtLroED0lA=' 
WHERE 
  key_id = 'f3e592ef3bd7531df1ed461061df1b8f8d77f0075f0249cd099cd496924c1c27' 
  AND (
    token = 'kB9fHYSfnqtRhoUoZVsbJ/z0sMBzPOflyEtLroED0lA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028