There is no universal database of stolen iPhones. If in doubt, walk away from the sale.
Purchase from Apple or Apple authorized retailer for your area to avoid problems.
Sealing a box is a trivial exercise. You might take your purchase home and find you
now own a box of rocks.
You can check warranty status (and get an idea of when originally sold) by entering
the serial number here:
https://selfsolve.apple.com/agreementWarrantyDynamic.do
You should also check to see if the iPhone is Activation Locked by entering the serial
number here:
https://www.icloud.com/activationlock/
Be advised that the warranty is valid only in country of original purchase. It is a common
scam to sell an iPhone in working condition and then report it lost/stolen to make an
insurance claim. Seller gets your money + money from insurance and you have an
inoperative iPhone.