UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FpZcDFWjmvHUgJMeblM8Yp6I0JH7VoM8A3CBMupghyk='
WHERE
key_id = '8375998e3dbdc4c22ac4d86a2686570428ea9e718760d889e1d241748aeca89f'
AND (
token = 'FpZcDFWjmvHUgJMeblM8Yp6I0JH7VoM8A3CBMupghyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)