UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LsWBgpgggtPHYtljFsq3FzpG0l9fdDUGvTMRaE/uJBw='
WHERE
key_id = '2562ef1ebc881141edf1eee75e1c800f67133fdce256d2f4c74b785995bf79f0'
AND (
token = 'LsWBgpgggtPHYtljFsq3FzpG0l9fdDUGvTMRaE/uJBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)