UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wGgEIbmSM3N0TY2nrOO3FB+Cpp5RPtuwIsCR6PonI4='
WHERE
key_id = 'ece38a2ac5a1a84616e9c79c183363a4a6e6a5b2c9daddc1df9dfe14975453ac'
AND (
token = '/wGgEIbmSM3N0TY2nrOO3FB+Cpp5RPtuwIsCR6PonI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)