UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfJD31bAPNx+ppETVm2mtw7xMQ/v9ZmdFyTYuA6GZCI='
WHERE
key_id = '16946683b7e97c98eee9c43f2fb0ae1abf877ea21fe516110faf832d64b1e279'
AND (
token = 'rfJD31bAPNx+ppETVm2mtw7xMQ/v9ZmdFyTYuA6GZCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)