UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RCfF0Fst8AI+7S6JiFneC3in6s80BaF2x/LpKyJsGn0='
WHERE
key_id = 'd9a3f75967859b2965a7bc51f8ca96d5fea9318f035112eb32dd23a7f7153036'
AND (
token = 'RCfF0Fst8AI+7S6JiFneC3in6s80BaF2x/LpKyJsGn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)