UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9uJVtuvBP4j8CmRIKhqkjg+gyn9xrd7+RjHSLwUn0l0='
WHERE
key_id = '6abc6826845cfc563058ac99feb68e8b7802102b080368c16c8d4dde1675a600'
AND (
token = '9uJVtuvBP4j8CmRIKhqkjg+gyn9xrd7+RjHSLwUn0l0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)