UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1rPzeFWck77DKOjKr4geI3ZUZj5jZF/E/Rnxz8YZ8rY='
WHERE
key_id = '164d2be39ce80bc01649aff2c9ab6cd7e70cfa2121dfd164ae04cdfe3bea004f'
AND (
token = '1rPzeFWck77DKOjKr4geI3ZUZj5jZF/E/Rnxz8YZ8rY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)