UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1nBOYBMLwm9PxxZ2mZRaxaHaD/7iDaGgvxwRDoAb5ec=' 
WHERE 
  key_id = 'c08339c6b45caf8ca18a759d4ee9d76d178c2cd7469f444a7411cc9e944c9664' 
  AND (
    token = '1nBOYBMLwm9PxxZ2mZRaxaHaD/7iDaGgvxwRDoAb5ec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035