UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zjwHNQKpehoSy4nNT6mPfnjZoSPbj4gZdGYQfLuU78='
WHERE
key_id = '679a08d336389a768f14bd4ad2292c46897450e7cbdeaa2bb71887af01c026aa'
AND (
token = '7zjwHNQKpehoSy4nNT6mPfnjZoSPbj4gZdGYQfLuU78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)