UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TwMYeRS0Lpm960Xg8Ki9WZeqjPvjRyiBysygfHm+hYo='
WHERE
key_id = 'b07d634366be1c5ef3fe40cd009466661f416f31a2b5394c050687363182c20e'
AND (
token = 'TwMYeRS0Lpm960Xg8Ki9WZeqjPvjRyiBysygfHm+hYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)