UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XzDZGjGfjVKND4aMuriCBq10TBDBPRXlvtAPsukNeoo='
WHERE
key_id = '04fbd8e09db8aa0b031743dadd02fffc188ded375e437e1ffcc7b013b5552868'
AND (
token = 'XzDZGjGfjVKND4aMuriCBq10TBDBPRXlvtAPsukNeoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)