UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1EnWr8ITzFRDQuz+LfONJuy/7LTSkjpwfuT+3KaMc1o='
WHERE
key_id = '7bfbdf883eb8ba7e2e9743f60362a8e77c84c8f47c88e972b77075fb19b95c12'
AND (
token = '1EnWr8ITzFRDQuz+LfONJuy/7LTSkjpwfuT+3KaMc1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)