UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QcZ1KXp4qVb43V/pgjK9Q6mg54NpeYO8J+20asDFUYI=' 
WHERE 
  key_id = '633fa5046c0cb54b0043103ea983778f7d1a3a6b70aec08a9589206c385f04e2' 
  AND (
    token = 'QcZ1KXp4qVb43V/pgjK9Q6mg54NpeYO8J+20asDFUYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025