UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ym+A7trDNFOL3V+++MSHsHXzTqOGHkUSpPsTH9GD9HU=' 
WHERE 
  key_id = '7c2ed9d812079877d372423b32cdce1b5573a6f4e81679617f87a774c7ec4bb9' 
  AND (
    token = 'Ym+A7trDNFOL3V+++MSHsHXzTqOGHkUSpPsTH9GD9HU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022