UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nf1fWvGVpHnPRkcoXdOUm4L+l+3UiOKpGqgSBv66CVo=' 
WHERE 
  key_id = 'e3e82cad3a59435543259e13075ca5954f94786403cb1e22fbf9a2a7b07b4217' 
  AND (
    token = 'Nf1fWvGVpHnPRkcoXdOUm4L+l+3UiOKpGqgSBv66CVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029