UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'np84xf/Cs7T44JOiJwc9eT6xIkhufWT9EwlTYqrvE1E='
WHERE
key_id = 'a1f69a1ebb566210634758266c7d20accd4dcf83467d776bec657ef4f1a7cca9'
AND (
token = 'np84xf/Cs7T44JOiJwc9eT6xIkhufWT9EwlTYqrvE1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)