UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N/iIyL99lerRkgoZQH/ZDXTmT5FpaT/Z+h2PkQauBpU=' 
WHERE 
  key_id = '044b8dfb0bfa2e48d41e143ff6dd87e03c898dbd5ac385ef16edc7199ebd7fe0' 
  AND (
    token = 'N/iIyL99lerRkgoZQH/ZDXTmT5FpaT/Z+h2PkQauBpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023