UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vUxT1OAx9Gx7FvyGoDhP3uqII/msTYP6vnqf2gQaSTc='
WHERE
key_id = '9afbdfc981e61b2275a22cbfdce28252a59ec09a2d2093c346bab9ce670be04d'
AND (
token = 'vUxT1OAx9Gx7FvyGoDhP3uqII/msTYP6vnqf2gQaSTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)