UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'STySdYdt4aP42OY5aDRlaIiM/bjHy8emDCVcx9LB/RE='
WHERE
key_id = 'cfe9e6eb8770c332be5f26df50bbde397925ea1311ecfe5ace211edbf86a8fa3'
AND (
token = 'STySdYdt4aP42OY5aDRlaIiM/bjHy8emDCVcx9LB/RE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)