UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z9zFEwcSSXvGcLTl+S+xN34DNi1WUNKS+3xFBsRrEZU=' 
WHERE 
  key_id = 'ce8f0a43fe388b50ae1233cfe926cd80d431480d6339600729dbe3d355f0fb5b' 
  AND (
    token = 'z9zFEwcSSXvGcLTl+S+xN34DNi1WUNKS+3xFBsRrEZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043