UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1o/pWPZ5so1Sx9L0gdcN+ZQgGFvn3HaQQVnLMhZtFA=' 
WHERE 
  key_id = '9839007f6683b2b8d98e220628502d357535f4d942e5e878e5e11a56dd90dfdb' 
  AND (
    token = '/1o/pWPZ5so1Sx9L0gdcN+ZQgGFvn3HaQQVnLMhZtFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058