UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9t3NuxXMt61L9E7jgLDb8dPivX22/wmWvdI0IXqY+HQ=' 
WHERE 
  key_id = 'de9cbe7512143e53ce721ff71fd1d453fabc31210e5ff20cc887be92c6e2d66b' 
  AND (
    token = '9t3NuxXMt61L9E7jgLDb8dPivX22/wmWvdI0IXqY+HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020