UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G4RVofN3mic4HwLMyTSrom68QOEyUHKlgDEVwlaEJaU='
WHERE
key_id = 'e4e6911d61b1d942228682ae7249505cbb07c4e4545f7be45b1195ba17dc160a'
AND (
token = 'G4RVofN3mic4HwLMyTSrom68QOEyUHKlgDEVwlaEJaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)