UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wJVSmLCXMNRn9dyIcVw8wpRKuaOB0UF4XL4oQBtKkFU='
WHERE
key_id = '302cad395fd54ef1ee3ab1847ad080fa90a38ee81327e0137ac16ab0f34f7160'
AND (
token = 'wJVSmLCXMNRn9dyIcVw8wpRKuaOB0UF4XL4oQBtKkFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)