UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BWby5dYeGMGwLiJ887wcM5LNTJ2LMgZ/MWv0d0ZZCUk='
WHERE
key_id = 'b65e0b5b5a805cac66ca175a3ec8d7b75e8fa1010ffb036fedc9aa0a5387835c'
AND (
token = 'BWby5dYeGMGwLiJ887wcM5LNTJ2LMgZ/MWv0d0ZZCUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)