UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8QSfR+6pfFzWq2b03HxD9vqRKqpf2cX2/sgSAQBpkZA=' 
WHERE 
  key_id = '8ebf4cd7165fdffc8a4c085b30939d82c26b558cfc2e3bae21ae1a3240274122' 
  AND (
    token = '8QSfR+6pfFzWq2b03HxD9vqRKqpf2cX2/sgSAQBpkZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032