UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wc8JJeGzfKNZE0Zpm3MpXMWG2CtxE2K+e2a3+VNN21s='
WHERE
key_id = '03dfc01f675ec60fb9a322ce0bea76c52adf8250a33b916a47f723837363c908'
AND (
token = 'Wc8JJeGzfKNZE0Zpm3MpXMWG2CtxE2K+e2a3+VNN21s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)