How long will a peanut butter sandwich last?
Generally, peanut butter has a fairly good shelf life. Putting it on bread doesn't change that.

Ordinary salted butter should also be alright for a day or two, as long as it wasn't in direct sunlight or high moisture or anything like that.

Most importantly, both butter and peanut butter will not spoil in a way that goes unnoticed. They will smell or feel wrong very obviously.

Disclaimer: This is not restaurant level hygiene advice, and probably contradicts public-health guidelines. It's certainly good enough for your own sandwiches though.