UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8iQZgWsN9v9EK+kx0rhqRNxn2GVrK/IuY/hvb9jyn0='
WHERE
key_id = 'ef3967f977e0534fcbcf54c9593ab2ab93d2f6bff4b579924aafe22b9f7fce40'
AND (
token = '+8iQZgWsN9v9EK+kx0rhqRNxn2GVrK/IuY/hvb9jyn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)