UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nx8Y9XeacFezlWFhFD0uyC3849MQKkgMg1JSIeQNtK8='
WHERE
key_id = '5abe8d6946141e6782afd32e2a122562ca2f581f18431bbf87941c16407e4a15'
AND (
token = 'Nx8Y9XeacFezlWFhFD0uyC3849MQKkgMg1JSIeQNtK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)