UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mUv+aJWHWd2xNJSMsl6zCyZ16nqefZKuJ4tZzgZ5Tpg='
WHERE
key_id = 'f3014d544734486bf0edfca4e7ec84e29e9a3695444de423fae5d8e6fd4b6926'
AND (
token = 'mUv+aJWHWd2xNJSMsl6zCyZ16nqefZKuJ4tZzgZ5Tpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)