UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eB/i7ZY4XFekno9IF5KxCyJWchOioMXUMilC/ATjVoY=' 
WHERE 
  key_id = 'd683969e154377e82ffaadbfec64c039e936ad3860eba5af73e35a04f60a89e1' 
  AND (
    token = 'eB/i7ZY4XFekno9IF5KxCyJWchOioMXUMilC/ATjVoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030