UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EyMRCv8laS87lCiM/EXERo9eRSBv3JlG6gO2+jvWo70=' 
WHERE 
  key_id = 'ffbe28314c0d545fefff64e5210d0eddd70f7cf9dd9f1bcf03b15dcf16857cec' 
  AND (
    token = 'EyMRCv8laS87lCiM/EXERo9eRSBv3JlG6gO2+jvWo70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041