UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C9L3OQj4yKzVWPMmHM8RSuR9O7aqjW710f/fPUgxPQc='
WHERE
key_id = '89e7eba43cf00bbd2b864978aafa403bee92f0c0cdf5b6d0e52c04b03c758c04'
AND (
token = 'C9L3OQj4yKzVWPMmHM8RSuR9O7aqjW710f/fPUgxPQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)