UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AXoL+pSGNMORlkYMA/l5I0TqQKBTjqfVd73m8gi2ExQ='
WHERE
key_id = '9122d3eb020b598e039e758cabbb2fd2054d83bb789a05b8ab5bbd5fa140dd74'
AND (
token = 'AXoL+pSGNMORlkYMA/l5I0TqQKBTjqfVd73m8gi2ExQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)