UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9VRPbXnWv3qMDj0NDG6Qy87N9XCHYSWRQwcE1Ntj4tg='
WHERE
key_id = '0b20fc9bd629fa82fec10f12807de92dcc7d53e2cab46dcb433a1b7bd66dd860'
AND (
token = '9VRPbXnWv3qMDj0NDG6Qy87N9XCHYSWRQwcE1Ntj4tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)